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.



22919
22920
22921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22919

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22917
22918
22919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22917

def value
  @value
end

Class Method Details

.ALLObject



22939
22940
22941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22939

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



22924
22925
22926
22927
22928
22929
22930
22931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22924

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



22955
22956
22957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22955

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



22934
22935
22936
22937
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22934

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

.getObject



22943
22944
22945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22943

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

.patchObject



22959
22960
22961
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22959

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

.postObject



22947
22948
22949
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22947

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

.putObject



22951
22952
22953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22951

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

Instance Method Details

#to_hashObject



22963
22964
22965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22963

def to_hash
  value
end