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.



9522
9523
9524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9522

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9520
9521
9522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9520

def value
  @value
end

Class Method Details

.adjustmentObject

The details of any adjustments made to the order.



9547
9548
9549
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9547

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

.ALLObject



9542
9543
9544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9542

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



9527
9528
9529
9530
9531
9532
9533
9534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9527

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.



9578
9579
9580
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9578

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

.dutyObject

The details of any duties owed on the order.



9563
9564
9565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9563

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



9537
9538
9539
9540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9537

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.



9573
9574
9575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9573

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

.shippingObject

The details of shipping costs for the order.



9568
9569
9570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9568

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

.subtotalObject

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



9553
9554
9555
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9553

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

.vatObject

The details of any VAT owed on the order.



9558
9559
9560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9558

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

Instance Method Details

#to_hashObject



9582
9583
9584
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9582

def to_hash
  value
end