Class: Podio::ItemField

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

Overview

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

.find_values(item_id, field_id) ⇒ Object



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

def find_values(item_id, field_id)
  Podio.connection.get("/item/#{item_id}/value/#{field_id}").body
end

.get_field_ranges(field_id) ⇒ Object



34
35
36
# File 'lib/podio/models/item_field.rb', line 34

def get_field_ranges(field_id)
  Podio.connection.get("/item/field/#{field_id}/range").body
end

.ical_entry(item_id, field_id) ⇒ Object



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

def ical_entry(item_id, field_id)
  Podio.connection.get("/calendar/item/#{item_id}/field/#{field_id}/ics/").body
end

.update(item_id, field_id, values, options = {}) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/podio/models/item_field.rb', line 20

def update(item_id, field_id, values, options = {})
  response = Podio.connection.put do |req|
    req.url("/item/#{item_id}/value/#{field_id}", options)
    req.body = values
  end
  response.body
end