Class: Cadooz::Immutable::Order
- Inherits:
-
Object
- Object
- Cadooz::Immutable::Order
- Includes:
- Mixins
- Defined in:
- lib/cadooz/models/immutable/order.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#commission ⇒ Object
readonly
Returns the value of attribute commission.
-
#cost_owner ⇒ Object
readonly
Returns the value of attribute cost_owner.
-
#cost_unit ⇒ Object
readonly
Returns the value of attribute cost_unit.
-
#credit_or_number ⇒ Object
readonly
Returns the value of attribute credit_or_number.
-
#customer_reference_number ⇒ Object
readonly
Returns the value of attribute customer_reference_number.
-
#delivery_address ⇒ Object
readonly
Returns the value of attribute delivery_address.
-
#generation_profile ⇒ Object
readonly
Returns the value of attribute generation_profile.
-
#greeting_card ⇒ Object
readonly
Returns the value of attribute greeting_card.
-
#invoice_address ⇒ Object
readonly
Returns the value of attribute invoice_address.
-
#invoice_information ⇒ Object
readonly
Returns the value of attribute invoice_information.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#order_attributes ⇒ Object
readonly
Returns the value of attribute order_attributes.
-
#order_description ⇒ Object
readonly
Returns the value of attribute order_description.
-
#order_positions ⇒ Object
readonly
Returns the value of attribute order_positions.
-
#payment_informations ⇒ Object
readonly
Returns the value of attribute payment_informations.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#send_mail ⇒ Object
readonly
Returns the value of attribute send_mail.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#website ⇒ Object
readonly
Returns the value of attribute website.
Instance Method Summary collapse
-
#initialize(open_struct) ⇒ Order
constructor
A new instance of Order.
Methods included from Mixins
#cadooz_class, #default_value_for_nil, #instance_variables_empty?, #serialize
Constructor Details
#initialize(open_struct) ⇒ Order
Returns a new instance of Order.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cadooz/models/immutable/order.rb', line 10 def initialize(open_struct) @client = open_struct&.client @commission = open_struct&.commission @cost_owner = open_struct&.cost_owner @cost_unit = open_struct&.cost_unit @credit_or_number = open_struct&.credit_or_number @customer_reference_number = open_struct&.customer_reference_number @delivery_address = Cadooz::Immutable::Address.new(open_struct&.delivery_address) @generation_profile = open_struct&.generation_profile @greeting_card = Cadooz::Immutable::GreetingCard.new(open_struct&.greeting_card) @invoice_address = Cadooz::Immutable::Address.new(open_struct&.invoice_address) @invoice_information = Array(open_struct&.invoice_information)&.each_with_object([]) { |i, arr| arr << Cadooz::Immutable::InvoiceInformation.new(i) } @language = open_struct&.language @order_attributes = open_struct&.order_attributes&.inject({}) { |hash, element| hash.merge(element.key.to_sym => element.value) } @order_description = open_struct&.order_description @order_positions = Array(open_struct&.order_positions)&.each_with_object([]) { |o, arr| arr << Cadooz::Immutable::OrderPosition.new(o) } @payment_informations = open_struct&.payment_informations @queue = open_struct&.queue @send_mail = open_struct&.send_mail @test = open_struct&.test @website = open_struct&.website self.freeze end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def client @client end |
#commission ⇒ Object (readonly)
Returns the value of attribute commission.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def commission @commission end |
#cost_owner ⇒ Object (readonly)
Returns the value of attribute cost_owner.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def cost_owner @cost_owner end |
#cost_unit ⇒ Object (readonly)
Returns the value of attribute cost_unit.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def cost_unit @cost_unit end |
#credit_or_number ⇒ Object (readonly)
Returns the value of attribute credit_or_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def credit_or_number @credit_or_number end |
#customer_reference_number ⇒ Object (readonly)
Returns the value of attribute customer_reference_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def customer_reference_number @customer_reference_number end |
#delivery_address ⇒ Object (readonly)
Returns the value of attribute delivery_address.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def delivery_address @delivery_address end |
#generation_profile ⇒ Object (readonly)
Returns the value of attribute generation_profile.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def generation_profile @generation_profile end |
#greeting_card ⇒ Object (readonly)
Returns the value of attribute greeting_card.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def greeting_card @greeting_card end |
#invoice_address ⇒ Object (readonly)
Returns the value of attribute invoice_address.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def invoice_address @invoice_address end |
#invoice_information ⇒ Object (readonly)
Returns the value of attribute invoice_information.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def invoice_information @invoice_information end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def language @language end |
#order_attributes ⇒ Object (readonly)
Returns the value of attribute order_attributes.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def order_attributes @order_attributes end |
#order_description ⇒ Object (readonly)
Returns the value of attribute order_description.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def order_description @order_description end |
#order_positions ⇒ Object (readonly)
Returns the value of attribute order_positions.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def order_positions @order_positions end |
#payment_informations ⇒ Object (readonly)
Returns the value of attribute payment_informations.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def payment_informations @payment_informations end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def queue @queue end |
#send_mail ⇒ Object (readonly)
Returns the value of attribute send_mail.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def send_mail @send_mail end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def test @test end |
#website ⇒ Object (readonly)
Returns the value of attribute website.
4 5 6 |
# File 'lib/cadooz/models/immutable/order.rb', line 4 def website @website end |