Class: Io::Flow::V0::Models::OrderType

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) ⇒ OrderType

Returns a new instance of OrderType.



21046
21047
21048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21046

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21044
21045
21046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21044

def value
  @value
end

Class Method Details

.ALLObject



21066
21067
21068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21066

def OrderType.ALL
  @@all ||= [OrderType.standard, OrderType.replacement]
end

.apply(value) ⇒ Object

Returns the instance of OrderType for this value, creating a new instance for an unknown value



21051
21052
21053
21054
21055
21056
21057
21058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21051

def OrderType.apply(value)
  if value.instance_of?(OrderType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OrderType.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of OrderType for this value, or nil if not found



21061
21062
21063
21064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21061

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

.replacementObject



21074
21075
21076
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21074

def OrderType.replacement
  @@_replacement ||= OrderType.new('replacement')
end

.standardObject



21070
21071
21072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21070

def OrderType.standard
  @@_standard ||= OrderType.new('standard')
end

Instance Method Details

#to_hashObject



21078
21079
21080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21078

def to_hash
  value
end