Class: TinCan
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(app_id, app_key, app_name) ⇒ TinCan
constructor
A new instance of TinCan.
- #validate ⇒ Object
Constructor Details
#initialize(app_id, app_key, app_name) ⇒ TinCan
Returns a new instance of TinCan.
10 11 12 |
# File 'lib/tincan.rb', line 10 def initialize(app_id, app_key, app_name) @id, @key, @name = app_id, app_key, app_name end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/tincan.rb', line 8 def id @id end |
#key ⇒ Object
Returns the value of attribute key.
8 9 10 |
# File 'lib/tincan.rb', line 8 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/tincan.rb', line 8 def name @name end |
Instance Method Details
#validate ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/tincan.rb', line 27 def validate return read_response( self.class.get( "/#{@name}/authorized", :basic_auth => {:username => @id, :password => @key} ).body ) end |