Class: OptimizePlayer::Project
Instance Attribute Summary
Attributes inherited from ApiObject
#context
Instance Method Summary
collapse
Methods inherited from ApiObject
#[], #[]=, #add_accessors, #as_json, construct_from, #delete, #initialize, #keys, #metaclass, #method_missing, #refresh, #refresh_from, #remove_accessors, #respond_to_missing?, #save, #to_hash, #to_json, #values
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class OptimizePlayer::ApiObject
Instance Method Details
#id ⇒ Object
8
9
10
|
# File 'lib/optimize_player/project.rb', line 8
def id
cid
end
|
#inspect ⇒ Object
3
4
5
6
|
# File 'lib/optimize_player/project.rb', line 3
def inspect()
cid_string = (self.respond_to?(:cid) && !self.cid.nil?) ? " cid=#{self.cid}" : ""
"#<#{self.class}:0x#{self.object_id.to_s(16)}#{cid_string}> JSON: " + JSON.pretty_generate(@data)
end
|
#set_position(position) ⇒ Object
12
13
14
15
16
|
# File 'lib/optimize_player/project.rb', line 12
def set_position(position)
response = context.client.send_request("projects/#{id}/set_position", :put, position: position)
refresh_from(response)
self
end
|
#toggle_favorite ⇒ Object
18
19
20
21
22
|
# File 'lib/optimize_player/project.rb', line 18
def toggle_favorite
response = context.client.send_request("projects/#{id}/toggle_favorite", :put)
refresh_from(response)
self
end
|