Class: Io::Flow::V0::Models::OrderRefundSummaryPartialCharged
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderRefundSummaryPartialCharged
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of OrderRefundSummaryPartialCharged for this value, creating a new instance for an unknown value.
- .by_quantity_percentage ⇒ Object
- .by_value_percentage ⇒ Object
- .for_order ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of OrderRefundSummaryPartialCharged for this value, or nil if not found.
- .per_item ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ OrderRefundSummaryPartialCharged
constructor
A new instance of OrderRefundSummaryPartialCharged.
- #to_hash ⇒ Object
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
#value ⇒ Object (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
.ALL ⇒ Object
23734 23735 23736 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23734 def OrderRefundSummaryPartialCharged.ALL @@all ||= [OrderRefundSummaryPartialCharged.per_item, OrderRefundSummaryPartialCharged.for_order, OrderRefundSummaryPartialCharged.by_value_percentage, OrderRefundSummaryPartialCharged.by_quantity_percentage] end |
.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_percentage ⇒ Object
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_percentage ⇒ Object
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_order ⇒ Object
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_item ⇒ Object
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_hash ⇒ Object
23754 23755 23756 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23754 def to_hash value end |