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.



25951
25952
25953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25951

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



25949
25950
25951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25949

def value
  @value
end

Class Method Details

.ALLObject



25971
25972
25973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25971

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



25956
25957
25958
25959
25960
25961
25962
25963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25956

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



25975
25976
25977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25975

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

.deletingObject



25979
25980
25981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25979

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



25966
25967
25968
25969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25966

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

.updatingObject



25983
25984
25985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25983

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

Instance Method Details

#to_hashObject



25987
25988
25989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25987

def to_hash
  value
end