Class: Io::Flow::V0::Models::RateType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RateType
- 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 RateType for this value, creating a new instance for an unknown value.
-
.flow ⇒ Object
Represents a Flow rate type (which excludes currency margins).
-
.from_string(value) ⇒ Object
Returns the instance of RateType for this value, or nil if not found.
-
.organization ⇒ Object
Represents an organization rate type (which includes currency margins).
Instance Method Summary collapse
-
#initialize(value) ⇒ RateType
constructor
A new instance of RateType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ RateType
Returns a new instance of RateType.
15536 15537 15538 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15536 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15534 15535 15536 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15534 def value @value end |
Class Method Details
.ALL ⇒ Object
15556 15557 15558 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15556 def RateType.ALL @@all ||= [RateType.flow, RateType.organization] end |
.apply(value) ⇒ Object
Returns the instance of RateType for this value, creating a new instance for an unknown value
15541 15542 15543 15544 15545 15546 15547 15548 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15541 def RateType.apply(value) if value.instance_of?(RateType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || RateType.new(value)) end end |
.flow ⇒ Object
Represents a Flow rate type (which excludes currency margins)
15561 15562 15563 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15561 def RateType.flow @@_flow ||= RateType.new('flow') end |
.from_string(value) ⇒ Object
Returns the instance of RateType for this value, or nil if not found
15551 15552 15553 15554 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15551 def RateType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) RateType.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
15570 15571 15572 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15570 def to_hash value end |