Class: Io::Flow::V0::Models::OrderStatus

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

Returns a new instance of OrderStatus.



18534
18535
18536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18534

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18532
18533
18534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18532

def value
  @value
end

Class Method Details

.ALLObject



18554
18555
18556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18554

def OrderStatus.ALL
  @@all ||= [OrderStatus.open, OrderStatus.]
end

.apply(value) ⇒ Object

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



18539
18540
18541
18542
18543
18544
18545
18546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18539

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

.from_string(value) ⇒ Object

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



18549
18550
18551
18552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18549

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

.openObject



18558
18559
18560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18558

def OrderStatus.open
  @@_open ||= OrderStatus.new('open')
end

.submittedObject



18562
18563
18564
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18562

def OrderStatus.
   ||= OrderStatus.new('submitted')
end

Instance Method Details

#to_hashObject



18566
18567
18568
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18566

def to_hash
  value
end