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.



17755
17756
17757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17755

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17753
17754
17755
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17753

def value
  @value
end

Class Method Details

.ALLObject



17775
17776
17777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17775

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



17760
17761
17762
17763
17764
17765
17766
17767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17760

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



17791
17792
17793
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17791

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



17770
17771
17772
17773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17770

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

.getObject



17779
17780
17781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17779

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

.patchObject



17795
17796
17797
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17795

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

.postObject



17783
17784
17785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17783

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

.putObject



17787
17788
17789
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17787

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

Instance Method Details

#to_hashObject



17799
17800
17801
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17799

def to_hash
  value
end