Class: NetSuite::Records::PricingMatrix
- Inherits:
-
Object
- Object
- NetSuite::Records::PricingMatrix
- Includes:
- Namespaces::PlatformCore
- Defined in:
- lib/netsuite/records/pricing_matrix.rb
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ PricingMatrix
constructor
A new instance of PricingMatrix.
- #prices ⇒ Object
- #to_record ⇒ Object
Methods included from Namespaces::PlatformCore
Constructor Details
#initialize(attributes = {}) ⇒ PricingMatrix
Returns a new instance of PricingMatrix.
6 7 8 9 10 11 12 |
# File 'lib/netsuite/records/pricing_matrix.rb', line 6 def initialize(attributes = {}) attributes[:pricing] = [attributes[:pricing]] unless attributes[:pricing].is_a? Array attributes[:pricing].each do |pricing| prices << RecordRef.new(pricing) end if attributes[:pricing] end |
Instance Method Details
#prices ⇒ Object
14 15 16 |
# File 'lib/netsuite/records/pricing_matrix.rb', line 14 def prices @prices ||= [] end |
#to_record ⇒ Object
18 19 20 |
# File 'lib/netsuite/records/pricing_matrix.rb', line 18 def to_record { "#{record_namespace}:item" => prices.map(&:to_record) } end |