Module: LibNio
- Defined in:
- lib/ruby-libnio.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#link ⇒ Object
Returns the value of attribute link.
-
#sticky ⇒ Object
Returns the value of attribute sticky.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#icon ⇒ Object
Returns the value of attribute icon.
6 7 8 |
# File 'lib/ruby-libnio.rb', line 6 def icon @icon end |
#link ⇒ Object
Returns the value of attribute link.
6 7 8 |
# File 'lib/ruby-libnio.rb', line 6 def link @link end |
#sticky ⇒ Object
Returns the value of attribute sticky.
6 7 8 |
# File 'lib/ruby-libnio.rb', line 6 def sticky @sticky end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/ruby-libnio.rb', line 6 def title @title end |
Class Method Details
.included(base) ⇒ Object
8 9 10 11 12 |
# File 'lib/ruby-libnio.rb', line 8 def self.included(base) base.send(:include, HTTParty) base.send(:base_uri, 'api.notify.io') base.extend ClassMethods end |
Instance Method Details
#notify(userhash, opts = {}) ⇒ Object
25 26 27 |
# File 'lib/ruby-libnio.rb', line 25 def notify(userhash, opts = {}) self.class.post("/v1/notify/#{userhash}?api_key=#{api_key}", :body => opts) end |
#notify_all(userhashes, opts = {}) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/ruby-libnio.rb', line 29 def notify_all(userhashes, opts = {}) responses = [] userhashes.each do |user| responses << self.class.post("/v1/notify/#{user}?api_key=#{api_key}", :body => opts) end responses end |