Class: Jumble::REST::Connection
- Inherits:
-
Object
- Object
- Jumble::REST::Connection
- Defined in:
- lib/jumble/rest/connection.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#reset_at ⇒ Object
Returns the value of attribute reset_at.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #alive? ⇒ Boolean
-
#initialize(payload) ⇒ Connection
constructor
A new instance of Connection.
- #reset(reset_at) ⇒ Object
Constructor Details
#initialize(payload) ⇒ Connection
Returns a new instance of Connection.
7 8 9 10 |
# File 'lib/jumble/rest/connection.rb', line 7 def initialize(payload) @reset_at = Time.now @client = Twitter::REST::Client.new(payload) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/jumble/rest/connection.rb', line 4 def client @client end |
#reset_at ⇒ Object
Returns the value of attribute reset_at.
5 6 7 |
# File 'lib/jumble/rest/connection.rb', line 5 def reset_at @reset_at end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 |
# File 'lib/jumble/rest/connection.rb', line 12 def <=>(other) reset_at <=> other.reset_at end |
#alive? ⇒ Boolean
16 17 18 |
# File 'lib/jumble/rest/connection.rb', line 16 def alive? reset_at < Time.now end |
#reset(reset_at) ⇒ Object
20 21 22 |
# File 'lib/jumble/rest/connection.rb', line 20 def reset(reset_at) self.reset_at = reset_at end |