Class: Podio::Filter

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/filter.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(app_id, attributes) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/podio/models/filter.rb', line 33

def create(app_id, attributes)
  response = Podio.connection.post do |req|
    req.url "/filter/app/#{app_id}/"
    req.body = attributes
  end

  response.body['filter_id']
end

.delete(filter_id) ⇒ Object



29
30
31
# File 'lib/podio/models/filter.rb', line 29

def delete(filter_id)
  Podio.connection.delete("/filter/#{filter_id}").status
end

.find(id) ⇒ Object



25
26
27
# File 'lib/podio/models/filter.rb', line 25

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

.find_all(app_id) ⇒ Object



19
20
21
22
23
# File 'lib/podio/models/filter.rb', line 19

def find_all(app_id)
  list Podio.connection.get { |req|
    req.url("/filter/app/#{app_id}/")
  }.body
end

.find_last(app_id) ⇒ Object



15
16
17
# File 'lib/podio/models/filter.rb', line 15

def find_last(app_id)
  member Podio.connection.get("/filter/app/#{app_id}/last").body
end