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.



14851
14852
14853
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14851

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14849
14850
14851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14849

def value
  @value
end

Class Method Details

.ALLObject



14871
14872
14873
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14871

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



14856
14857
14858
14859
14860
14861
14862
14863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14856

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



14887
14888
14889
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14887

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



14866
14867
14868
14869
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14866

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

.getObject



14875
14876
14877
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14875

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

.patchObject



14891
14892
14893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14891

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

.postObject



14879
14880
14881
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14879

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

.putObject



14883
14884
14885
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14883

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

Instance Method Details

#to_hashObject



14895
14896
14897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14895

def to_hash
  value
end