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.



14912
14913
14914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14912

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14910
14911
14912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14910

def value
  @value
end

Class Method Details

.ALLObject



14932
14933
14934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14932

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



14917
14918
14919
14920
14921
14922
14923
14924
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14917

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



14948
14949
14950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14948

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



14927
14928
14929
14930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14927

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

.getObject



14936
14937
14938
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14936

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

.patchObject



14952
14953
14954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14952

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

.postObject



14940
14941
14942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14940

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

.putObject



14944
14945
14946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14944

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

Instance Method Details

#to_hashObject



14956
14957
14958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14956

def to_hash
  value
end