Class: Polycom::Pusher
- Inherits:
-
Object
- Object
- Polycom::Pusher
- Defined in:
- lib/polycom/pusher.rb
Instance Attribute Summary collapse
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(args) ⇒ Pusher
constructor
A new instance of Pusher.
- #send(h) ⇒ Object
Constructor Details
#initialize(args) ⇒ Pusher
Returns a new instance of Pusher.
10 11 12 13 14 |
# File 'lib/polycom/pusher.rb', line 10 def initialize(args) args.each do |k, v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
#ip_address ⇒ Object
Returns the value of attribute ip_address.
8 9 10 |
# File 'lib/polycom/pusher.rb', line 8 def ip_address @ip_address end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/polycom/pusher.rb', line 8 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/polycom/pusher.rb', line 8 def username @username end |
Instance Method Details
#send(h) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/polycom/pusher.rb', line 17 def send(h) priority = h.fetch(:priority, :critical).to_s.capitalize data = h.fetch(:data, nil) url = h.fetch(:url, nil) if data.nil? && url.nil? raise "Either :data or :url must be passed to this method" end push_data(priority, data) unless data.nil? push_url(priority, url) unless url.nil? end |