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.



18560
18561
18562
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18560

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18558
18559
18560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18558

def value
  @value
end

Class Method Details

.ALLObject



18580
18581
18582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18580

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



18565
18566
18567
18568
18569
18570
18571
18572
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18565

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



18596
18597
18598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18596

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



18575
18576
18577
18578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18575

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

.getObject



18584
18585
18586
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18584

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

.patchObject



18600
18601
18602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18600

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

.postObject



18588
18589
18590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18588

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

.putObject



18592
18593
18594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18592

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

Instance Method Details

#to_hashObject



18604
18605
18606
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18604

def to_hash
  value
end