Module: Genius::Account
- Defined in:
- lib/genius/api/account.rb
Overview
Genius::Account
module provides methods to work with Genius account
Class Method Summary collapse
-
.account(token: nil) ⇒ Hash, NilClass
(also: me)
Genius::Account.account
-> value.
Class Method Details
.account(token: nil) ⇒ Hash, NilClass Also known as: me
22 23 24 25 26 27 28 29 |
# File 'lib/genius/api/account.rb', line 22 def account(token: nil) return if token.nil? && !Auth..nil? Errors.validate_token(token) unless token.nil? response = HTTParty.get("https://api.genius.com/account?access_token=#{token_ext(token)}").body JSON.parse(response) end |