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.
17603 17604 17605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17603 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17601 17602 17603 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17601 def value @value end |
Class Method Details
.ALL ⇒ Object
17623 17624 17625 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17623 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
17608 17609 17610 17611 17612 17613 17614 17615 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17608 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
17639 17640 17641 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17639 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
17618 17619 17620 17621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17618 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
17627 17628 17629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17627 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
17643 17644 17645 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17643 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
17631 17632 17633 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17631 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
17635 17636 17637 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17635 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
17647 17648 17649 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17647 def to_hash value end |