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.



14924
14925
14926
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14924

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14922
14923
14924
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14922

def value
  @value
end

Class Method Details

.ALLObject



14944
14945
14946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14944

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



14929
14930
14931
14932
14933
14934
14935
14936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14929

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



14960
14961
14962
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14960

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



14939
14940
14941
14942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14939

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

.getObject



14948
14949
14950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14948

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

.patchObject



14964
14965
14966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14964

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

.postObject



14952
14953
14954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14952

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

.putObject



14956
14957
14958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14956

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

Instance Method Details

#to_hashObject



14968
14969
14970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14968

def to_hash
  value
end