Class: Io::Flow::V0::Models::OrderRefundSummaryPartialCharged

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) ⇒ OrderRefundSummaryPartialCharged

Returns a new instance of OrderRefundSummaryPartialCharged.



23714
23715
23716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23714

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23712
23713
23714
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23712

def value
  @value
end

Class Method Details

.apply(value) ⇒ Object

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



23719
23720
23721
23722
23723
23724
23725
23726
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23719

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

.by_quantity_percentageObject



23750
23751
23752
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23750

def OrderRefundSummaryPartialCharged.by_quantity_percentage
  @@_by_quantity_percentage ||= OrderRefundSummaryPartialCharged.new('by_quantity_percentage')
end

.by_value_percentageObject



23746
23747
23748
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23746

def OrderRefundSummaryPartialCharged.by_value_percentage
  @@_by_value_percentage ||= OrderRefundSummaryPartialCharged.new('by_value_percentage')
end

.for_orderObject



23742
23743
23744
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23742

def OrderRefundSummaryPartialCharged.for_order
  @@_for_order ||= OrderRefundSummaryPartialCharged.new('for_order')
end

.from_string(value) ⇒ Object

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



23729
23730
23731
23732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23729

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

.per_itemObject



23738
23739
23740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23738

def OrderRefundSummaryPartialCharged.per_item
  @@_per_item ||= OrderRefundSummaryPartialCharged.new('per_item')
end

Instance Method Details

#to_hashObject



23754
23755
23756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23754

def to_hash
  value
end