Class: Paid::OrderItem
- Inherits:
-
APIResource
- Object
- APIResource
- Paid::OrderItem
- Defined in:
- lib/paid/order_item.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#order ⇒ Object
Returns the value of attribute order.
-
#plan_item ⇒ Object
Returns the value of attribute plan_item.
-
#product ⇒ Object
Returns the value of attribute product.
-
#service_ends_on ⇒ Object
Returns the value of attribute service_ends_on.
-
#service_starts_on ⇒ Object
Returns the value of attribute service_starts_on.
-
#transaction ⇒ Object
Returns the value of attribute transaction.
Attributes inherited from APIResource
Class Method Summary collapse
- .all(params = {}, headers = {}) ⇒ Object
- .create(params = {}, headers = {}) ⇒ Object
- .retrieve(id, params = {}, headers = {}) ⇒ Object
Instance Method Summary collapse
Methods inherited from APIResource
add_api_attribute, api_attribute_names, #api_attributes, api_subclass_fetch, api_subclasses, #changed_api_attributes, #clear_api_attributes, determine_api_attribute_value, #determine_api_attribute_value, #initialize, #inspect, #inspect_api_attributes, #inspect_nested, #refresh_from, register_api_subclass, #to_json
Constructor Details
This class inherits a constructor from Paid::APIResource
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/paid/order_item.rb', line 3 def id @id end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/paid/order_item.rb', line 4 def object @object end |
#order ⇒ Object
Returns the value of attribute order.
5 6 7 |
# File 'lib/paid/order_item.rb', line 5 def order @order end |
#plan_item ⇒ Object
Returns the value of attribute plan_item.
6 7 8 |
# File 'lib/paid/order_item.rb', line 6 def plan_item @plan_item end |
#product ⇒ Object
Returns the value of attribute product.
7 8 9 |
# File 'lib/paid/order_item.rb', line 7 def product @product end |
#service_ends_on ⇒ Object
Returns the value of attribute service_ends_on.
8 9 10 |
# File 'lib/paid/order_item.rb', line 8 def service_ends_on @service_ends_on end |
#service_starts_on ⇒ Object
Returns the value of attribute service_starts_on.
9 10 11 |
# File 'lib/paid/order_item.rb', line 9 def service_starts_on @service_starts_on end |
#transaction ⇒ Object
Returns the value of attribute transaction.
10 11 12 |
# File 'lib/paid/order_item.rb', line 10 def transaction @transaction end |
Class Method Details
.all(params = {}, headers = {}) ⇒ Object
12 13 14 15 |
# File 'lib/paid/order_item.rb', line 12 def self.all(params={}, headers={}) method = APIMethod.new(:get, "/order_items", params, headers, self) APIList.new(self, method.execute, method) end |
.create(params = {}, headers = {}) ⇒ Object
25 26 27 28 |
# File 'lib/paid/order_item.rb', line 25 def self.create(params={}, headers={}) method = APIMethod.new(:post, "/order_items", params, headers, self) self.new(method.execute, method) end |
.retrieve(id, params = {}, headers = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/paid/order_item.rb', line 17 def self.retrieve(id, params={}, headers={}) params = ParamsBuilder.merge(params, { :id => id }) method = APIMethod.new(:get, "/order_items/:id", params, headers, self) self.new(method.execute, method) end |
Instance Method Details
#refresh(params = {}, headers = {}) ⇒ Object
30 31 32 33 |
# File 'lib/paid/order_item.rb', line 30 def refresh(params={}, headers={}) method = APIMethod.new(:get, "/order_items/:id", params, headers, self) self.refresh_from(method.execute, method) end |
#save(params = {}, headers = {}) ⇒ Object
35 36 37 38 39 |
# File 'lib/paid/order_item.rb', line 35 def save(params={}, headers={}) params = ParamsBuilder.merge(params, changed_api_attributes) method = APIMethod.new(:put, "/order_items/:id", params, headers, self) self.refresh_from(method.execute, method) end |