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.



25997
25998
25999
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25997

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



25995
25996
25997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25995

def value
  @value
end

Class Method Details

.ALLObject



26017
26018
26019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26017

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



26002
26003
26004
26005
26006
26007
26008
26009
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26002

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



26012
26013
26014
26015
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26012

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

.openObject



26021
26022
26023
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26021

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

.refundedObject



26025
26026
26027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26025

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

Instance Method Details

#to_hashObject



26029
26030
26031
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26029

def to_hash
  value
end