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



17418
17419
17420
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17418

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17416
17417
17418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17416

def value
  @value
end

Class Method Details

.ALLObject



17438
17439
17440
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17438

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



17423
17424
17425
17426
17427
17428
17429
17430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17423

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



17433
17434
17435
17436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17433

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

.openObject



17442
17443
17444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17442

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

.submittedObject



17446
17447
17448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17446

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

Instance Method Details

#to_hashObject



17450
17451
17452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17450

def to_hash
  value
end