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.



17538
17539
17540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17538

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17536
17537
17538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17536

def value
  @value
end

Class Method Details

.ALLObject



17558
17559
17560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17558

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



17543
17544
17545
17546
17547
17548
17549
17550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17543

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.



17563
17564
17565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17563

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



17553
17554
17555
17556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17553

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.



17568
17569
17570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17568

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

Instance Method Details

#to_hashObject



17572
17573
17574
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17572

def to_hash
  value
end