Class: Io::Flow::V0::Models::ReturnStatus

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

Returns a new instance of ReturnStatus.



18468
18469
18470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18468

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18466
18467
18468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18466

def value
  @value
end

Class Method Details

.ALLObject



18488
18489
18490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18488

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

.apply(value) ⇒ Object

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



18473
18474
18475
18476
18477
18478
18479
18480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18473

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

.from_string(value) ⇒ Object

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



18483
18484
18485
18486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18483

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

.openObject



18492
18493
18494
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18492

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

.refundedObject



18496
18497
18498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18496

def ReturnStatus.refunded
  @@_refunded ||= ReturnStatus.new('refunded')
end

Instance Method Details

#to_hashObject



18500
18501
18502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18500

def to_hash
  value
end