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.



18964
18965
18966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18964

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18962
18963
18964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18962

def value
  @value
end

Class Method Details

.ALLObject



18984
18985
18986
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18984

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



18969
18970
18971
18972
18973
18974
18975
18976
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18969

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



19000
19001
19002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19000

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



18979
18980
18981
18982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18979

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

.getObject



18988
18989
18990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18988

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

.patchObject



19004
19005
19006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19004

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

.postObject



18992
18993
18994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18992

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

.putObject



18996
18997
18998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18996

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

Instance Method Details

#to_hashObject



19008
19009
19010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19008

def to_hash
  value
end