Class: Podio::Live

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/live.rb

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes

Class Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, has_many, has_one, #hash, #initialize, #initialize_attributes, klass_from_string, list, member, #new_record?, output_attribute_as_json, #parent_model, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.accept(id) ⇒ Object



35
36
37
# File 'lib/podio/models/live.rb', line 35

def accept(id)
  Podio.connection.post("/live/#{id}/accept").status
end

.create(ref_type, ref_id, attributes) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/podio/models/live.rb', line 14

def create(ref_type, ref_id, attributes)
  response = Podio.connection.post do |req|
    req.url "/live/#{ref_type}/#{ref_id}"
    req.body = attributes
  end

  member response.body
end

.decline(id) ⇒ Object



39
40
41
# File 'lib/podio/models/live.rb', line 39

def decline(id)
  Podio.connection.post("/live/#{id}/decline").status
end

.delete(id) ⇒ Object



31
32
33
# File 'lib/podio/models/live.rb', line 31

def delete(id)
  Podio.connection.delete("/live/#{id}").body
end

.update(id, attributes) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/podio/models/live.rb', line 23

def update(id, attributes)
  response = Podio.connection.put do |req|
    req.url "/live/#{id}/settings"
    req.body = attributes
  end
  response.status
end