Class: Opium::Push
- Includes:
- Model::Connectable
- Defined in:
- lib/opium/push.rb
Instance Attribute Summary collapse
-
#channels ⇒ Object
Returns the value of attribute channels.
-
#data ⇒ Object
Returns the value of attribute data.
-
#expiration_interval ⇒ Object
Returns the value of attribute expiration_interval.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#push_at ⇒ Object
Returns the value of attribute push_at.
-
#where ⇒ Object
(also: #criteria)
Returns the value of attribute where.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(attributes = {}) ⇒ Push
constructor
A new instance of Push.
Constructor Details
#initialize(attributes = {}) ⇒ Push
Returns a new instance of Push.
33 34 35 36 37 |
# File 'lib/opium/push.rb', line 33 def initialize( attributes = {} ) self.channels = [] self.data = {}.with_indifferent_access attributes.each {|k, v| self.send( "#{k}=", v )} end |
Instance Attribute Details
#channels ⇒ Object
Returns the value of attribute channels.
39 40 41 |
# File 'lib/opium/push.rb', line 39 def channels @channels end |
#data ⇒ Object
Returns the value of attribute data.
39 40 41 |
# File 'lib/opium/push.rb', line 39 def data @data end |
#expiration_interval ⇒ Object
Returns the value of attribute expiration_interval.
39 40 41 |
# File 'lib/opium/push.rb', line 39 def expiration_interval @expiration_interval end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
39 40 41 |
# File 'lib/opium/push.rb', line 39 def expires_at @expires_at end |
#push_at ⇒ Object
Returns the value of attribute push_at.
39 40 41 |
# File 'lib/opium/push.rb', line 39 def push_at @push_at end |
#where ⇒ Object Also known as: criteria
Returns the value of attribute where.
39 40 41 |
# File 'lib/opium/push.rb', line 39 def where @where end |
Instance Method Details
#create ⇒ Object
46 47 48 49 50 51 |
# File 'lib/opium/push.rb', line 46 def create self.class.as_resource(:push) do result = self.class.http_post post_data result[:result] end end |