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.



18654
18655
18656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18654

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18652
18653
18654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18652

def value
  @value
end

Class Method Details

.ALLObject



18674
18675
18676
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18674

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



18659
18660
18661
18662
18663
18664
18665
18666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18659

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



18690
18691
18692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18690

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



18669
18670
18671
18672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18669

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

.getObject



18678
18679
18680
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18678

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

.patchObject



18694
18695
18696
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18694

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

.postObject



18682
18683
18684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18682

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

.putObject



18686
18687
18688
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18686

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

Instance Method Details

#to_hashObject



18698
18699
18700
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18698

def to_hash
  value
end