Class: Paid::Product
- Inherits:
-
APIResource
- Object
- APIResource
- Paid::Product
- Defined in:
- lib/paid/product.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#external_metric_id ⇒ Object
Returns the value of attribute external_metric_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#pricing_structure ⇒ Object
Returns the value of attribute pricing_structure.
-
#transaction_description ⇒ Object
Returns the value of attribute transaction_description.
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
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/paid/product.rb', line 5 def description @description end |
#external_id ⇒ Object
Returns the value of attribute external_id.
6 7 8 |
# File 'lib/paid/product.rb', line 6 def external_id @external_id end |
#external_metric_id ⇒ Object
Returns the value of attribute external_metric_id.
7 8 9 |
# File 'lib/paid/product.rb', line 7 def external_metric_id @external_metric_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/paid/product.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/paid/product.rb', line 8 def name @name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/paid/product.rb', line 4 def object @object end |
#pricing_structure ⇒ Object
Returns the value of attribute pricing_structure.
10 11 12 |
# File 'lib/paid/product.rb', line 10 def pricing_structure @pricing_structure end |
#transaction_description ⇒ Object
Returns the value of attribute transaction_description.
9 10 11 |
# File 'lib/paid/product.rb', line 9 def transaction_description @transaction_description end |
Class Method Details
.all(params = {}, headers = {}) ⇒ Object
13 14 15 16 |
# File 'lib/paid/product.rb', line 13 def self.all(params={}, headers={}) method = APIMethod.new(:get, "/products", params, headers, self) APIList.new(self, method.execute, method) end |
.create(params = {}, headers = {}) ⇒ Object
26 27 28 29 |
# File 'lib/paid/product.rb', line 26 def self.create(params={}, headers={}) method = APIMethod.new(:post, "/products", params, headers, self) self.new(method.execute, method) end |
.retrieve(id, params = {}, headers = {}) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/paid/product.rb', line 18 def self.retrieve(id, params={}, headers={}) params = ParamsBuilder.merge(params, { :id => id }) method = APIMethod.new(:get, "/products/:id", params, headers, self) self.new(method.execute, method) end |
Instance Method Details
#refresh(params = {}, headers = {}) ⇒ Object
31 32 33 34 |
# File 'lib/paid/product.rb', line 31 def refresh(params={}, headers={}) method = APIMethod.new(:get, "/products/:id", params, headers, self) self.refresh_from(method.execute, method) end |
#save(params = {}, headers = {}) ⇒ Object
36 37 38 39 40 |
# File 'lib/paid/product.rb', line 36 def save(params={}, headers={}) params = ParamsBuilder.merge(params, changed_api_attributes) method = APIMethod.new(:put, "/products/:id", params, headers, self) self.refresh_from(method.execute, method) end |