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.
17833 17834 17835 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17833 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17831 17832 17833 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17831 def value @value end |
Class Method Details
.ALL ⇒ Object
17853 17854 17855 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17853 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
17838 17839 17840 17841 17842 17843 17844 17845 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17838 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
17869 17870 17871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17869 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
17848 17849 17850 17851 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17848 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
17857 17858 17859 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17857 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
17873 17874 17875 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17873 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
17861 17862 17863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17861 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
17865 17866 17867 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17865 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
17877 17878 17879 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17877 def to_hash value end |