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.
16060 16061 16062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16060 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16058 16059 16060 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16058 def value @value end |
Class Method Details
.ALL ⇒ Object
16080 16081 16082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16080 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
16065 16066 16067 16068 16069 16070 16071 16072 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16065 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)
16085 16086 16087 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16085 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
16075 16076 16077 16078 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16075 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
16094 16095 16096 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16094 def to_hash value end |