Class: AdvancedBilling::ProductPricePointErrors
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::ProductPricePointErrors
- Defined in:
- lib/advanced_billing/models/product_price_point_errors.rb
Overview
ProductPricePointErrors Model.
Instance Attribute Summary collapse
-
#interval ⇒ Array[String]
TODO: Write general description for this method.
-
#interval_unit ⇒ Array[String]
TODO: Write general description for this method.
-
#name ⇒ Array[String]
TODO: Write general description for this method.
-
#price ⇒ Array[String]
TODO: Write general description for this method.
-
#price_in_cents ⇒ Array[String]
TODO: Write general description for this method.
-
#price_point ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(price_point: SKIP, interval: SKIP, interval_unit: SKIP, name: SKIP, price: SKIP, price_in_cents: SKIP, additional_properties: {}) ⇒ ProductPricePointErrors
constructor
A new instance of ProductPricePointErrors.
Methods inherited from BaseModel
Constructor Details
#initialize(price_point: SKIP, interval: SKIP, interval_unit: SKIP, name: SKIP, price: SKIP, price_in_cents: SKIP, additional_properties: {}) ⇒ ProductPricePointErrors
Returns a new instance of ProductPricePointErrors.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 65 def initialize(price_point: SKIP, interval: SKIP, interval_unit: SKIP, name: SKIP, price: SKIP, price_in_cents: SKIP, additional_properties: {}) @price_point = price_point unless price_point == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP @name = name unless name == SKIP @price = price unless price == SKIP @price_in_cents = price_in_cents unless price_in_cents == SKIP # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#interval ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 18 def interval @interval end |
#interval_unit ⇒ Array[String]
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 22 def interval_unit @interval_unit end |
#name ⇒ Array[String]
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 26 def name @name end |
#price ⇒ Array[String]
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 30 def price @price end |
#price_in_cents ⇒ Array[String]
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 34 def price_in_cents @price_in_cents end |
#price_point ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 14 def price_point @price_point end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. price_point = hash.key?('price_point') ? hash['price_point'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP price = hash.key?('price') ? hash['price'] : SKIP price_in_cents = hash.key?('price_in_cents') ? hash['price_in_cents'] : SKIP # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. ProductPricePointErrors.new(price_point: price_point, interval: interval, interval_unit: interval_unit, name: name, price: price, price_in_cents: price_in_cents, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['price_point'] = 'price_point' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' @_hash['name'] = 'name' @_hash['price'] = 'price' @_hash['price_in_cents'] = 'price_in_cents' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/advanced_billing/models/product_price_point_errors.rb', line 49 def self.optionals %w[ price_point interval interval_unit name price price_in_cents ] end |