Class: Rushover::User

Inherits:
Object
  • Object
show all
Defined in:
lib/rushover.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, client) ⇒ User

Returns a new instance of User.



50
51
52
53
# File 'lib/rushover.rb', line 50

def initialize(key, client)
  @key = key
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



48
49
50
# File 'lib/rushover.rb', line 48

def client
  @client
end

#keyObject

Returns the value of attribute key.



48
49
50
# File 'lib/rushover.rb', line 48

def key
  @key
end

Instance Method Details

#notify(message, options = {}) ⇒ Object



55
56
57
# File 'lib/rushover.rb', line 55

def notify(message, options = {})
  client.notify(key, message, options)
end

#validate(device = nil) ⇒ Object



59
60
61
# File 'lib/rushover.rb', line 59

def validate(device = nil)
  client.validate(key, device)
end

#validate!(device = nil) ⇒ Object



63
64
65
# File 'lib/rushover.rb', line 63

def validate!(device = nil)
  validate(device).ok?
end