Class: Io::Flow::V0::Models::OrderPriceDetailKey

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ OrderPriceDetailKey

Returns a new instance of OrderPriceDetailKey.



8605
8606
8607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8605

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8603
8604
8605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8603

def value
  @value
end

Class Method Details

.adjustmentObject

The details of any adjustments made to the order.



8630
8631
8632
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8630

def OrderPriceDetailKey.adjustment
  @@_adjustment ||= OrderPriceDetailKey.new('adjustment')
end

.ALLObject



8625
8626
8627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8625

def OrderPriceDetailKey.ALL
  @@all ||= [OrderPriceDetailKey.adjustment, OrderPriceDetailKey.subtotal, OrderPriceDetailKey.vat, OrderPriceDetailKey.duty, OrderPriceDetailKey.shipping, OrderPriceDetailKey.insurance, OrderPriceDetailKey.discount]
end

.apply(value) ⇒ Object

Returns the instance of OrderPriceDetailKey for this value, creating a new instance for an unknown value



8610
8611
8612
8613
8614
8615
8616
8617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8610

def OrderPriceDetailKey.apply(value)
  if value.instance_of?(OrderPriceDetailKey)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OrderPriceDetailKey.new(value))
  end
end

.discountObject

The details of any discount applied to the order.



8661
8662
8663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8661

def OrderPriceDetailKey.discount
  @@_discount ||= OrderPriceDetailKey.new('discount')
end

.dutyObject

The details of any duties owed on the order.



8646
8647
8648
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8646

def OrderPriceDetailKey.duty
  @@_duty ||= OrderPriceDetailKey.new('duty')
end

.from_string(value) ⇒ Object

Returns the instance of OrderPriceDetailKey for this value, or nil if not found



8620
8621
8622
8623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8620

def OrderPriceDetailKey.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  OrderPriceDetailKey.ALL.find { |v| v.value == value }
end

.insuranceObject

The details of insurance costs for the order.



8656
8657
8658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8656

def OrderPriceDetailKey.insurance
  @@_insurance ||= OrderPriceDetailKey.new('insurance')
end

.shippingObject

The details of shipping costs for the order.



8651
8652
8653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8651

def OrderPriceDetailKey.shipping
  @@_shipping ||= OrderPriceDetailKey.new('shipping')
end

.subtotalObject

The details of the subtotal for the order, including item prices, margins, and rounding.



8636
8637
8638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8636

def OrderPriceDetailKey.subtotal
  @@_subtotal ||= OrderPriceDetailKey.new('subtotal')
end

.vatObject

The details of any VAT owed on the order.



8641
8642
8643
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8641

def OrderPriceDetailKey.vat
  @@_vat ||= OrderPriceDetailKey.new('vat')
end

Instance Method Details

#to_hashObject



8665
8666
8667
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8665

def to_hash
  value
end