100% free for Open Source, forever. Get another set of eyes on your code.

Take a look. Our new design is currently in beta, but you can start using it today!

A
 

Echowrap::API::Oauth

Updated more than 3 months ago.

No issues here.

Congrats! Give yourself time to reflect on your awesome coding skillz.

require 'echowrap/api/utils'

module Echowrap
  module API
    module Oauth
      include Echowrap::API::Utils

      # Returns the current time of The Echo Nest API server. This time can be used to synchronize the local time with The Echo Nest allowing you to set a proper timestamp used generate authenticated requests to the API. This call returns the number of seconds elapsed since midnight, 1 January 1970.
      # @see http://developer.echonest.com/docs/v4/oauth.html#timestamp
      # @authentication Requires api key
      # @raise [Echowrap::Error::Unauthorized] Error raised when supplied api key is not valid.
      # @return [Integer]
      # @param options [Hash] A customizable set of options.
      #
      # @return [Integer]
      # @example Return integer timestamp
      #   Echowrap.oauth_timestamp
      def oauth_timestamp(options={})
        response = send(:get, '/api/v4/oauth/timestamp', options)
        response[:body][:response][:current_time]
      end

    end
  end
end
10
Complexity
0
Duplication
25
Lines
1
Methods
9.7
Complexity / M
0
Churn
12
Lines of Code
12
LOC / Method