Class: Rushover::User
- Inherits:
-
Object
- Object
- Rushover::User
- Defined in:
- lib/rushover.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key, client) ⇒ User
constructor
A new instance of User.
- #notify(message, options = {}) ⇒ Object
- #validate(device = nil) ⇒ Object
- #validate!(device = nil) ⇒ Object
Constructor Details
#initialize(key, client) ⇒ User
Returns a new instance of User.
49 50 51 52 |
# File 'lib/rushover.rb', line 49 def initialize(key, client) @key = key @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
47 48 49 |
# File 'lib/rushover.rb', line 47 def client @client end |
#key ⇒ Object
Returns the value of attribute key.
47 48 49 |
# File 'lib/rushover.rb', line 47 def key @key end |
Instance Method Details
#notify(message, options = {}) ⇒ Object
54 55 56 |
# File 'lib/rushover.rb', line 54 def notify(, = {}) client.notify(key, , ) end |
#validate(device = nil) ⇒ Object
58 59 60 |
# File 'lib/rushover.rb', line 58 def validate(device = nil) client.validate(key, device) end |
#validate!(device = nil) ⇒ Object
62 63 64 |
# File 'lib/rushover.rb', line 62 def validate!(device = nil) validate(device).ok? end |