Class: Parse::Push
- Inherits:
- 
      Object
      
        - Object
- Parse::Push
 
- Defined in:
- lib/parse/push.rb
Instance Attribute Summary collapse
- 
  
    
      #channel  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute channel. 
- 
  
    
      #channels  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute channels. 
- 
  
    
      #data  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute data. 
- 
  
    
      #expiration_time  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute expiration_time. 
- 
  
    
      #expiration_time_interval  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute expiration_time_interval. 
- 
  
    
      #type  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute type. 
- 
  
    
      #where  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute where. 
Instance Method Summary collapse
- 
  
    
      #initialize(data, channel = "")  ⇒ Push 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Push. 
- #save ⇒ Object
Constructor Details
#initialize(data, channel = "") ⇒ Push
Returns a new instance of Push.
| 14 15 16 17 | # File 'lib/parse/push.rb', line 14 def initialize(data, channel = "") @data = data @channel = channel end | 
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
| 7 8 9 | # File 'lib/parse/push.rb', line 7 def channel @channel end | 
#channels ⇒ Object
Returns the value of attribute channels.
| 6 7 8 | # File 'lib/parse/push.rb', line 6 def channels @channels end | 
#data ⇒ Object
Returns the value of attribute data.
| 12 13 14 | # File 'lib/parse/push.rb', line 12 def data @data end | 
#expiration_time ⇒ Object
Returns the value of attribute expiration_time.
| 11 12 13 | # File 'lib/parse/push.rb', line 11 def expiration_time @expiration_time end | 
#expiration_time_interval ⇒ Object
Returns the value of attribute expiration_time_interval.
| 10 11 12 | # File 'lib/parse/push.rb', line 10 def expiration_time_interval @expiration_time_interval end | 
#type ⇒ Object
Returns the value of attribute type.
| 9 10 11 | # File 'lib/parse/push.rb', line 9 def type @type end | 
#where ⇒ Object
Returns the value of attribute where.
| 8 9 10 | # File 'lib/parse/push.rb', line 8 def where @where end | 
Instance Method Details
#save ⇒ Object
| 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # File 'lib/parse/push.rb', line 19 def save uri = Protocol.push_uri body = { :data => @data, :channel => @channel } if @channels body.merge!({ :channels => @channels }) body.delete :channel end if @where body.merge!({ :where => @where }) body.delete :channel end body.merge!({ :expiration_interval => @expiration_time_interval }) if @expiration_time_interval body.merge!({ :expiration_time => @expiration_time }) if @expiration_time body.merge!({ :type => @type }) if @type response = Parse.client.request uri, :post, body.to_json, nil end |