Class: Io::Flow::V0::Models::PermittedHttpMethod
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PermittedHttpMethod
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of PermittedHttpMethod for this value, creating a new instance for an unknown value.
- .delete ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of PermittedHttpMethod for this value, or nil if not found.
- .get ⇒ Object
- .patch ⇒ Object
- .post ⇒ Object
- .put ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ PermittedHttpMethod
constructor
A new instance of PermittedHttpMethod.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PermittedHttpMethod
Returns a new instance of PermittedHttpMethod.
15436 15437 15438 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15436 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15434 15435 15436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15434 def value @value end |
Class Method Details
.ALL ⇒ Object
15456 15457 15458 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15456 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
15441 15442 15443 15444 15445 15446 15447 15448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15441 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 |
.delete ⇒ Object
15472 15473 15474 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15472 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
15451 15452 15453 15454 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15451 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
15460 15461 15462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15460 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
15476 15477 15478 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15476 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
15464 15465 15466 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15464 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
15468 15469 15470 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15468 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
15480 15481 15482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15480 def to_hash value end |