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.



14503
14504
14505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14503

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14501
14502
14503
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14501

def value
  @value
end

Class Method Details

.ALLObject



14523
14524
14525
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14523

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



14508
14509
14510
14511
14512
14513
14514
14515
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14508

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



14518
14519
14520
14521
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14518

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

.openObject



14527
14528
14529
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14527

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

.refundedObject



14531
14532
14533
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14531

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

Instance Method Details

#to_hashObject



14535
14536
14537
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14535

def to_hash
  value
end