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.



18099
18100
18101
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18099

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18097
18098
18099
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18097

def value
  @value
end

Class Method Details

.ALLObject



18119
18120
18121
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18119

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



18104
18105
18106
18107
18108
18109
18110
18111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18104

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



18135
18136
18137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18135

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



18114
18115
18116
18117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18114

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

.getObject



18123
18124
18125
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18123

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

.patchObject



18139
18140
18141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18139

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

.postObject



18127
18128
18129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18127

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

.putObject



18131
18132
18133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18131

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

Instance Method Details

#to_hashObject



18143
18144
18145
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18143

def to_hash
  value
end