Class: Podio::PromotionGroup

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/promotion_group.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

.create(attributes) ⇒ Object



22
23
24
25
26
27
# File 'lib/podio/models/promotion_group.rb', line 22

def create(attributes)
  member Podio.connection.post { |req| 
    req.url("/promotion_group/")
    req.body = attributes
  }.body
end

.delete(promotion_group_id) ⇒ Object



45
46
47
# File 'lib/podio/models/promotion_group.rb', line 45

def delete(promotion_group_id)
  Podio.connection.delete("/promotion_group/#{promotion_group_id}")
end

.disable(promotion_group_id) ⇒ Object



41
42
43
# File 'lib/podio/models/promotion_group.rb', line 41

def disable(promotion_group_id)
  member Podio.connection.post("/promotion_group/#{promotion_group_id}/disable").body
end

.enable(promotion_group_id) ⇒ Object



37
38
39
# File 'lib/podio/models/promotion_group.rb', line 37

def enable(promotion_group_id)
  member Podio.connection.post("/promotion_group/#{promotion_group_id}/enable").body
end

.find(promotion_group_id) ⇒ Object



18
19
20
# File 'lib/podio/models/promotion_group.rb', line 18

def find(promotion_group_id)
  member Podio.connection.get("/promotion_group/#{promotion_group_id}").body
end

.find_all(options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/podio/models/promotion_group.rb', line 12

def find_all(options={})
  list Podio.connection.get { |req| 
    req.url("/promotion_group/", options)
  }.body
end

.update(promotion_group_id, attributes) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/podio/models/promotion_group.rb', line 29

def update(promotion_group_id, attributes)
  puts promotion_group_id, attributes
  member Podio.connection.put { |req|
    req.url("/promotion_group/#{promotion_group_id}")
    req.body = attributes
  }.body
end