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.



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

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

Instance Attribute Details

#clientObject

Returns the value of attribute client.



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

def client
  @client
end

#keyObject

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(message, options = {})
  client.notify(key, message, options)
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