Class: NetSuite::Records::PricingMatrix

Inherits:
Object
  • Object
show all
Includes:
Namespaces::PlatformCore
Defined in:
lib/netsuite/records/pricing_matrix.rb

Instance Method Summary collapse

Methods included from Namespaces::PlatformCore

#record_namespace

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

#pricesObject



14
15
16
# File 'lib/netsuite/records/pricing_matrix.rb', line 14

def prices
  @prices ||= []
end

#to_recordObject



18
19
20
# File 'lib/netsuite/records/pricing_matrix.rb', line 18

def to_record
  { "#{record_namespace}:item" => prices.map(&:to_record) }
end