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.



10783
10784
10785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10783

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10781
10782
10783
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10781

def value
  @value
end

Class Method Details

.ALLObject



10803
10804
10805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10803

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



10788
10789
10790
10791
10792
10793
10794
10795
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10788

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



10798
10799
10800
10801
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10798

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

.openObject



10807
10808
10809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10807

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

.refundedObject



10811
10812
10813
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10811

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

Instance Method Details

#to_hashObject



10815
10816
10817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10815

def to_hash
  value
end