Class: Frame::ProductPhase
Constant Summary
collapse
- OBJECT_NAME =
"product_phase"
Instance Attribute Summary
Attributes inherited from FrameObject
#id, #original_values
Class Method Summary
collapse
-
.bulk_update(product_id, phases, opts = {}) ⇒ Object
-
.create(product_id, params = {}, opts = {}) ⇒ Object
-
.delete(product_id, id, params = {}, opts = {}) ⇒ Object
-
.list(product_id, params = {}, opts = {}) ⇒ Object
-
.object_name ⇒ Object
-
.retrieve(product_id, id, opts = {}) ⇒ Object
Instance Method Summary
collapse
create
list
#serialize_params
Methods inherited from APIResource
class_name, #refresh, resource_url, #resource_url
included
Methods inherited from FrameObject
#[], #[]=, construct_from, #each, #initialize, #initialize_from, #inspect, #keys, #serialize_params, #to_hash, #to_s, #update_attributes, #values
Class Method Details
.bulk_update(product_id, phases, opts = {}) ⇒ Object
43
44
45
46
47
48
49
50
|
# File 'lib/frame/resources/product_phase.rb', line 43
def self.bulk_update(product_id, phases, opts = {})
request_object(
:patch,
"/v1/products/#{CGI.escape(product_id)}/phases/bulk_update",
{phases: phases},
opts
)
end
|
.create(product_id, params = {}, opts = {}) ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/frame/resources/product_phase.rb', line 16
def self.create(product_id, params = {}, opts = {})
request_object(
:post,
"/v1/products/#{CGI.escape(product_id)}/phases",
params,
opts
)
end
|
.delete(product_id, id, params = {}, opts = {}) ⇒ Object
52
53
54
55
56
57
58
59
|
# File 'lib/frame/resources/product_phase.rb', line 52
def self.delete(product_id, id, params = {}, opts = {})
request_object(
:delete,
"/v1/products/#{CGI.escape(product_id)}/phases/#{CGI.escape(id)}",
params,
opts
)
end
|
.list(product_id, params = {}, opts = {}) ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/frame/resources/product_phase.rb', line 25
def self.list(product_id, params = {}, opts = {})
request_object(
:get,
"/v1/products/#{CGI.escape(product_id)}/phases",
params,
opts
)
end
|
.object_name ⇒ Object
12
13
14
|
# File 'lib/frame/resources/product_phase.rb', line 12
def self.object_name
OBJECT_NAME
end
|
.retrieve(product_id, id, opts = {}) ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'lib/frame/resources/product_phase.rb', line 34
def self.retrieve(product_id, id, opts = {})
request_object(
:get,
"/v1/products/#{CGI.escape(product_id)}/phases/#{CGI.escape(id)}",
{},
opts
)
end
|
Instance Method Details
#delete(params = {}, opts = {}) ⇒ Object
79
80
81
82
83
84
85
86
|
# File 'lib/frame/resources/product_phase.rb', line 79
def delete(params = {}, opts = {})
request_object(
:delete,
"/v1/products/#{CGI.escape(self["product"])}/phases/#{CGI.escape(self["id"])}",
params,
opts
)
end
|
#save(params = {}, opts = {}) ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/frame/resources/product_phase.rb', line 61
def save(params = {}, opts = {})
values = serialize_params(self).merge(params)
if values.empty?
return self
end
updated = request_object(
:patch,
"/v1/products/#{CGI.escape(self["product"])}/phases/#{CGI.escape(self["id"])}",
values,
opts
)
initialize_from(updated)
self
end
|