Class: Io::Flow::V0::Models::FlowEntity

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ FlowEntity

Returns a new instance of FlowEntity.



15964
15965
15966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15964

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15962
15963
15964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15962

def value
  @value
end

Class Method Details

.ALLObject



15984
15985
15986
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15984

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



15969
15970
15971
15972
15973
15974
15975
15976
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15969

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_canObject

Flow Commerce Canada Inc., Vancouver, BC, CAN



15999
16000
16001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15999

def FlowEntity.flow_can
  @@_flow_can ||= FlowEntity.new('flow-can')
end

.flow_irlObject

Flow Commerce Ltd., Dublin, IRL



15994
15995
15996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15994

def FlowEntity.flow_irl
  @@_flow_irl ||= FlowEntity.new('flow-irl')
end

.flow_usaObject

Flow Commerce Inc., Hoboken, NJ, USA



15989
15990
15991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15989

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



15979
15980
15981
15982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15979

def FlowEntity.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  FlowEntity.ALL.find { |v| v.value == value }
end

Instance Method Details

#to_hashObject



16003
16004
16005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16003

def to_hash
  value
end