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.



18072
18073
18074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18072

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18070
18071
18072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18070

def value
  @value
end

Class Method Details

.ALLObject



18092
18093
18094
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18092

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



18077
18078
18079
18080
18081
18082
18083
18084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18077

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



18108
18109
18110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18108

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



18087
18088
18089
18090
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18087

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

.getObject



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

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

.patchObject



18112
18113
18114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18112

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

.postObject



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

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

.putObject



18104
18105
18106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18104

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

Instance Method Details

#to_hashObject



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

def to_hash
  value
end