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.
18703 18704 18705 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18703 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18701 18702 18703 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18701 def value @value end |
Class Method Details
.ALL ⇒ Object
18723 18724 18725 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18723 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
18708 18709 18710 18711 18712 18713 18714 18715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18708 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
18739 18740 18741 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18739 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
18718 18719 18720 18721 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18718 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
18727 18728 18729 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18727 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
18743 18744 18745 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18743 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
18731 18732 18733 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18731 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
18735 18736 18737 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18735 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
18747 18748 18749 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18747 def to_hash value end |