Class: Io::Flow::V0::Models::TransactionSource
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TransactionSource
- 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
- .adjustment ⇒ Object
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of TransactionSource for this value, creating a new instance for an unknown value.
- .capture ⇒ Object
- .dispute ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of TransactionSource for this value, or nil if not found.
- .refund ⇒ Object
- .shipping_label ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ TransactionSource
constructor
A new instance of TransactionSource.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TransactionSource
Returns a new instance of TransactionSource.
25897 25898 25899 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25897 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
25895 25896 25897 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25895 def value @value end |
Class Method Details
.adjustment ⇒ Object
25933 25934 25935 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25933 def TransactionSource.adjustment @@_adjustment ||= TransactionSource.new('adjustment') end |
.ALL ⇒ Object
25917 25918 25919 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25917 def TransactionSource.ALL @@all ||= [TransactionSource.capture, TransactionSource.refund, TransactionSource.dispute, TransactionSource.adjustment, TransactionSource.shipping_label] end |
.apply(value) ⇒ Object
Returns the instance of TransactionSource for this value, creating a new instance for an unknown value
25902 25903 25904 25905 25906 25907 25908 25909 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25902 def TransactionSource.apply(value) if value.instance_of?(TransactionSource) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TransactionSource.new(value)) end end |
.capture ⇒ Object
25921 25922 25923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25921 def TransactionSource.capture @@_capture ||= TransactionSource.new('capture') end |
.dispute ⇒ Object
25929 25930 25931 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25929 def TransactionSource.dispute @@_dispute ||= TransactionSource.new('dispute') end |
.from_string(value) ⇒ Object
Returns the instance of TransactionSource for this value, or nil if not found
25912 25913 25914 25915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25912 def TransactionSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TransactionSource.ALL.find { |v| v.value == value } end |
.refund ⇒ Object
25925 25926 25927 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25925 def TransactionSource.refund @@_refund ||= TransactionSource.new('refund') end |
.shipping_label ⇒ Object
25937 25938 25939 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25937 def TransactionSource.shipping_label @@_shipping_label ||= TransactionSource.new('shipping_label') end |
Instance Method Details
#to_hash ⇒ Object
25941 25942 25943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25941 def to_hash value end |