Class: Streak::FieldValue

Inherits:
StreakObject show all
Defined in:
lib/streak/field_value.rb

Class Method Summary collapse

Methods inherited from StreakObject

construct_from, convert_to_streak_object, #initialize, #method_missing, relations

Constructor Details

This class inherits a constructor from Streak::StreakObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Streak::StreakObject

Class Method Details

.all(box_key) ⇒ Object



7
8
9
10
# File 'lib/streak/field_value.rb', line 7

def self.all(box_key)
  res = Streak.request(:get, "/boxes/#{box_key}/fields")
  convert_to_streak_object(res, FieldValue)
end

.attributesObject



3
4
5
# File 'lib/streak/field_value.rb', line 3

def self.attributes
  [:key, :value]
end

.find(box_key, field_key) ⇒ Object



12
13
14
15
# File 'lib/streak/field_value.rb', line 12

def self.find(box_key, field_key)
  res = Streak.request(:get, "/boxes/#{box_key}/fields/#{field_key}")
  convert_to_streak_object(res, FieldValue)
end

.update(box_key, field_key, params = {}) ⇒ Object



17
18
19
20
# File 'lib/streak/field_value.rb', line 17

def self.update(box_key, field_key, params={})
  res = Streak.request(:post, "/boxes/#{box_key}/fields/#{field_key}", MultiJson.dump(params))
  convert_to_streak_object(res, FieldValue)
end