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.



23806
23807
23808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23806

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23804
23805
23806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23804

def value
  @value
end

Class Method Details

.ALLObject



23826
23827
23828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23826

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



23811
23812
23813
23814
23815
23816
23817
23818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23811

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.



23831
23832
23833
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23831

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



23821
23822
23823
23824
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23821

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.



23836
23837
23838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23836

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

Instance Method Details

#to_hashObject



23840
23841
23842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840

def to_hash
  value
end