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.



21782
21783
21784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21782

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21780
21781
21782
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21780

def value
  @value
end

Class Method Details

.ALLObject



21802
21803
21804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21802

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



21787
21788
21789
21790
21791
21792
21793
21794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21787

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



21818
21819
21820
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21818

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



21797
21798
21799
21800
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21797

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

.getObject



21806
21807
21808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21806

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

.patchObject



21822
21823
21824
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21822

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

.postObject



21810
21811
21812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21810

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

.putObject



21814
21815
21816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21814

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

Instance Method Details

#to_hashObject



21826
21827
21828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21826

def to_hash
  value
end