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.
18072 18073 18074 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18072 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18070 18071 18072 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18070 def value @value end |
Class Method Details
.ALL ⇒ Object
18092 18093 18094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18092 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
18077 18078 18079 18080 18081 18082 18083 18084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18077 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
18108 18109 18110 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18108 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
18087 18088 18089 18090 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18087 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
18096 18097 18098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18096 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
18112 18113 18114 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18112 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
18100 18101 18102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18100 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
18104 18105 18106 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18104 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
18116 18117 18118 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18116 def to_hash value end |