Class: Io::Flow::V0::Models::OrderStorage

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

Returns a new instance of OrderStorage.



21002
21003
21004
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21002

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21000
21001
21002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21000

def value
  @value
end

Class Method Details

.ALLObject



21022
21023
21024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21022

def OrderStorage.ALL
  @@all ||= [OrderStorage.do_not_persist, OrderStorage.persist]
end

.apply(value) ⇒ Object

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



21007
21008
21009
21010
21011
21012
21013
21014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21007

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

.do_not_persistObject

Indicates to not persist the order.



21027
21028
21029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21027

def OrderStorage.do_not_persist
  @@_do_not_persist ||= OrderStorage.new('do_not_persist')
end

.from_string(value) ⇒ Object

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



21017
21018
21019
21020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21017

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

.persistObject

Indicates to persist the order.



21032
21033
21034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21032

def OrderStorage.persist
  @@_persist ||= OrderStorage.new('persist')
end

Instance Method Details

#to_hashObject



21036
21037
21038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21036

def to_hash
  value
end