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.



18703
18704
18705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18703

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18701
18702
18703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18701

def value
  @value
end

Class Method Details

.ALLObject



18723
18724
18725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18723

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



18708
18709
18710
18711
18712
18713
18714
18715
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18708

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



18739
18740
18741
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18739

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



18718
18719
18720
18721
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18718

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

.getObject



18727
18728
18729
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18727

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

.patchObject



18743
18744
18745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18743

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

.postObject



18731
18732
18733
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18731

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

.putObject



18735
18736
18737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18735

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

Instance Method Details

#to_hashObject



18747
18748
18749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18747

def to_hash
  value
end