Class: Io::Flow::V0::Models::ReturnPolicyState

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

Returns a new instance of ReturnPolicyState.



22723
22724
22725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22723

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22721
22722
22723
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22721

def value
  @value
end

Class Method Details

.ALLObject



22743
22744
22745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22743

def ReturnPolicyState.ALL
  @@all ||= [ReturnPolicyState.current, ReturnPolicyState.deleting, ReturnPolicyState.updating]
end

.apply(value) ⇒ Object

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



22728
22729
22730
22731
22732
22733
22734
22735
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22728

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

.currentObject



22747
22748
22749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22747

def ReturnPolicyState.current
  @@_current ||= ReturnPolicyState.new('current')
end

.deletingObject



22751
22752
22753
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22751

def ReturnPolicyState.deleting
  @@_deleting ||= ReturnPolicyState.new('deleting')
end

.from_string(value) ⇒ Object

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



22738
22739
22740
22741
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22738

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

.updatingObject



22755
22756
22757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22755

def ReturnPolicyState.updating
  @@_updating ||= ReturnPolicyState.new('updating')
end

Instance Method Details

#to_hashObject



22759
22760
22761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22759

def to_hash
  value
end