Class: Podio::PromotionGroupMember

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

.add_members(promotion_group_id, attributes) ⇒ Object



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

def add_members(promotion_group_id, attributes)
  Podio.connection.post { |req| 
    req.url "/promotion_group/#{promotion_group_id}/members/add"
    req.body = attributes
  }.status
end

.create(attributes) ⇒ Object



10
11
12
13
14
15
# File 'lib/podio/models/promotion_group_member.rb', line 10

def create(attributes)
  member Podio.connection.post { |req| 
    req.url("/promotion_group/#{attributes[:promotion_group_id]}/add")
    req.body = attributes
  }.body
end

.find_all(promotion_group_id, options = {}) ⇒ Object



17
18
19
20
21
# File 'lib/podio/models/promotion_group_member.rb', line 17

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