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.



18576
18577
18578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18576

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18574
18575
18576
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18574

def value
  @value
end

Class Method Details

.ALLObject



18596
18597
18598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18596

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



18581
18582
18583
18584
18585
18586
18587
18588
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18581

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.



18601
18602
18603
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18601

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



18591
18592
18593
18594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18591

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.



18606
18607
18608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18606

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

Instance Method Details

#to_hashObject



18610
18611
18612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18610

def to_hash
  value
end