Class: Io::Flow::V0::Models::FlowEntity
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FlowEntity
- 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 FlowEntity for this value, creating a new instance for an unknown value.
-
.flow_can ⇒ Object
Flow Commerce Canada Inc., Vancouver, BC, CAN.
-
.flow_irl ⇒ Object
Flow Commerce Ltd., Dublin, IRL.
-
.flow_usa ⇒ Object
Flow Commerce Inc., Hoboken, NJ, USA.
-
.from_string(value) ⇒ Object
Returns the instance of FlowEntity for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ FlowEntity
constructor
A new instance of FlowEntity.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ FlowEntity
Returns a new instance of FlowEntity.
16058 16059 16060 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16058 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16056 16057 16058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16056 def value @value end |
Class Method Details
.ALL ⇒ Object
16078 16079 16080 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16078 def FlowEntity.ALL @@all ||= [FlowEntity.flow_usa, FlowEntity.flow_irl, FlowEntity.flow_can] end |
.apply(value) ⇒ Object
Returns the instance of FlowEntity for this value, creating a new instance for an unknown value
16063 16064 16065 16066 16067 16068 16069 16070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16063 def FlowEntity.apply(value) if value.instance_of?(FlowEntity) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || FlowEntity.new(value)) end end |
.flow_can ⇒ Object
Flow Commerce Canada Inc., Vancouver, BC, CAN
16093 16094 16095 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16093 def FlowEntity.flow_can @@_flow_can ||= FlowEntity.new('flow-can') end |
.flow_irl ⇒ Object
Flow Commerce Ltd., Dublin, IRL
16088 16089 16090 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16088 def FlowEntity.flow_irl @@_flow_irl ||= FlowEntity.new('flow-irl') end |
.flow_usa ⇒ Object
Flow Commerce Inc., Hoboken, NJ, USA
16083 16084 16085 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16083 def FlowEntity.flow_usa @@_flow_usa ||= FlowEntity.new('flow-usa') end |
.from_string(value) ⇒ Object
Returns the instance of FlowEntity for this value, or nil if not found
16073 16074 16075 16076 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16073 def FlowEntity.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) FlowEntity.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
16097 16098 16099 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16097 def to_hash value end |