Module: LeisureKing::Authentication
- Defined in:
- lib/leisureking/authentication.rb
Class Attribute Summary collapse
-
.token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
- .get_token ⇒ Object
-
.init! ⇒ Hash
Set’s the default value’s to nil and false.
Class Attribute Details
.token ⇒ Object
Returns the value of attribute token.
8 9 10 |
# File 'lib/leisureking/authentication.rb', line 8 def token @token end |
Class Method Details
.get_token ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/leisureking/authentication.rb', line 18 def get_token body = { apikey: LeisureKing::Config.api_key, secret: LeisureKing::Config.api_secret } result = LeisureKing::API.send_request("authenticate", body) if result["status"] && result["status"] == "OK" self.token = result["data"]["token"] end return result end |
.init! ⇒ Hash
Set’s the default value’s to nil and false
12 13 14 15 16 |
# File 'lib/leisureking/authentication.rb', line 12 def init! @defaults = { :@token => nil, } end |