Class: Opium::Push

Inherits:
Object show all
Includes:
Model::Connectable
Defined in:
lib/opium/push.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#channelsObject

Returns the value of attribute channels.



39
40
41
# File 'lib/opium/push.rb', line 39

def channels
  @channels
end

#dataObject

Returns the value of attribute data.



39
40
41
# File 'lib/opium/push.rb', line 39

def data
  @data
end

#expiration_intervalObject

Returns the value of attribute expiration_interval.



39
40
41
# File 'lib/opium/push.rb', line 39

def expiration_interval
  @expiration_interval
end

#expires_atObject

Returns the value of attribute expires_at.



39
40
41
# File 'lib/opium/push.rb', line 39

def expires_at
  @expires_at
end

#push_atObject

Returns the value of attribute push_at.



39
40
41
# File 'lib/opium/push.rb', line 39

def push_at
  @push_at
end

#whereObject 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

#createObject



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