Class: Withings::Api::ConsumerToken
- Inherits:
-
Object
- Object
- Withings::Api::ConsumerToken
- Defined in:
- lib/withings-api/tokens.rb
Overview
Encapsulates a consumer app key/secret pair
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
-
#initialize(*arguments) ⇒ ConsumerToken
constructor
Multiple variations.
- #to_a ⇒ Object
Constructor Details
#initialize(*arguments) ⇒ ConsumerToken
Multiple variations
-
#initialize()
-
#initialize(key, secret)
11 12 13 14 15 16 17 18 19 |
# File 'lib/withings-api/tokens.rb', line 11 def initialize(*arguments) if arguments.length == 0 elsif arguments.length == 2 self.key = arguments.shift self.secret = arguments.shift else raise ArgumentError end end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/withings-api/tokens.rb', line 5 def key @key end |
#secret ⇒ Object
Returns the value of attribute secret.
5 6 7 |
# File 'lib/withings-api/tokens.rb', line 5 def secret @secret end |
Instance Method Details
#to_a ⇒ Object
21 22 23 |
# File 'lib/withings-api/tokens.rb', line 21 def to_a [key, secret] end |