# What this is doing? I mean Digest.new('sha1') returns what?
  digest = OpenSSL::Digest::Digest.new('sha1')

# Is it so that we say HMAC.digest to use the SHA1 algorithm?
  hmac = OpenSSL::HMAC.digest(digest, SECRET_KEY, uri)

# What the chomp method does?
  signature = Base64.encode64(hmac).chomp

Asking these questions as they are not documented in the Ruby
documentation.

Regards,
Mohsin