Class: Io::Flow::V0::Models::PermittedHttpMethod

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

Returns a new instance of PermittedHttpMethod.



16834
16835
16836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16834

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16832
16833
16834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16832

def value
  @value
end

Class Method Details

.ALLObject



16854
16855
16856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16854

def PermittedHttpMethod.ALL
  @@all ||= [PermittedHttpMethod.get, PermittedHttpMethod.post, PermittedHttpMethod.put, PermittedHttpMethod.delete, PermittedHttpMethod.patch]
end

.apply(value) ⇒ Object

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



16839
16840
16841
16842
16843
16844
16845
16846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16839

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

.deleteObject



16870
16871
16872
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16870

def PermittedHttpMethod.delete
  @@_delete ||= PermittedHttpMethod.new('DELETE')
end

.from_string(value) ⇒ Object

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



16849
16850
16851
16852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16849

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

.getObject



16858
16859
16860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16858

def PermittedHttpMethod.get
  @@_get ||= PermittedHttpMethod.new('GET')
end

.patchObject



16874
16875
16876
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16874

def PermittedHttpMethod.patch
  @@_patch ||= PermittedHttpMethod.new('PATCH')
end

.postObject



16862
16863
16864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16862

def PermittedHttpMethod.post
  @@_post ||= PermittedHttpMethod.new('POST')
end

.putObject



16866
16867
16868
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16866

def PermittedHttpMethod.put
  @@_put ||= PermittedHttpMethod.new('PUT')
end

Instance Method Details

#to_hashObject



16878
16879
16880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16878

def to_hash
  value
end