Class: Sidemash::Sdk::Auth
- Inherits:
-
Object
- Object
- Sidemash::Sdk::Auth
- Defined in:
- lib/sidemash/sdk/auth.rb
Instance Attribute Summary collapse
-
#secret_key ⇒ Object
readonly
Returns the value of attribute secret_key.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(token, secret_key) ⇒ Auth
constructor
A new instance of Auth.
- #to_hash ⇒ Object
- #to_json(*a) ⇒ Object
- #to_remote ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(token, secret_key) ⇒ Auth
Returns a new instance of Auth.
25 26 27 28 29 |
# File 'lib/sidemash/sdk/auth.rb', line 25 def initialize(token, secret_key) @_type = 'Auth' @token = token @secret_key = secret_key end |
Instance Attribute Details
#secret_key ⇒ Object (readonly)
Returns the value of attribute secret_key.
23 24 25 |
# File 'lib/sidemash/sdk/auth.rb', line 23 def secret_key @secret_key end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
22 23 24 |
# File 'lib/sidemash/sdk/auth.rb', line 22 def token @token end |
Class Method Details
._type ⇒ Object
31 32 33 |
# File 'lib/sidemash/sdk/auth.rb', line 31 def self._type 'Auth' end |
.from_hash(h) ⇒ Object
61 62 63 64 |
# File 'lib/sidemash/sdk/auth.rb', line 61 def self.from_hash(h) Auth.new(h['token'], h['secret_key']) end |
Instance Method Details
#to_hash ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/sidemash/sdk/auth.rb', line 48 def to_hash result = {} result[:_type] = @_type result[:token] = @token result[:secret_key] = @secret_key result end |
#to_json(*a) ⇒ Object
66 67 68 |
# File 'lib/sidemash/sdk/auth.rb', line 66 def to_json(*a) to_hash.to_json(*a) end |
#to_remote ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/sidemash/sdk/auth.rb', line 40 def to_remote result = {} result[:_type] = @_type result[:token] = @token result[:secretKey] = @secret_key result end |
#to_s ⇒ Object
70 71 72 73 |
# File 'lib/sidemash/sdk/auth.rb', line 70 def to_s ('Auth(token=' + @token + ', secret_key=******' + ')') end |