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.



68
69
70
71
# File 'lib/rushover.rb', line 68

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

Instance Attribute Details

#clientObject

Returns the value of attribute client.



66
67
68
# File 'lib/rushover.rb', line 66

def client
  @client
end

#keyObject

Returns the value of attribute key.



66
67
68
# File 'lib/rushover.rb', line 66

def key
  @key
end

Instance Method Details

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



73
74
75
# File 'lib/rushover.rb', line 73

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

#validate(device = nil) ⇒ Object



77
78
79
# File 'lib/rushover.rb', line 77

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

#validate!(device = nil) ⇒ Object



81
82
83
# File 'lib/rushover.rb', line 81

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