Class: NeomodeClient::Auth
- Inherits:
-
Object
- Object
- NeomodeClient::Auth
- Includes:
- NeomodeClient
- Defined in:
- lib/neomode_client/auth.rb
Class Method Summary collapse
Instance Method Summary collapse
- #generate_token ⇒ Object
-
#initialize(args) ⇒ Auth
constructor
A new instance of Auth.
Methods included from NeomodeClient
Constructor Details
#initialize(args) ⇒ Auth
Returns a new instance of Auth.
6 7 8 9 10 |
# File 'lib/neomode_client/auth.rb', line 6 def initialize(args) @client_id = args[:client_id] @client_secret = args[:client_secret] @is_production = args[:is_production] end |
Class Method Details
.generate_token(args) ⇒ Object
12 13 14 |
# File 'lib/neomode_client/auth.rb', line 12 def self.generate_token(args) new(args).generate_token end |
Instance Method Details
#generate_token ⇒ Object
16 17 18 19 20 |
# File 'lib/neomode_client/auth.rb', line 16 def generate_token response = connection.post("/auth/token/anonymous", body.to_json) handler.new(response).parse! end |