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.
16834 16835 16836 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16834 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16832 16833 16834 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16832 def value @value end |
Class Method Details
.ALL ⇒ Object
16854 16855 16856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16854 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
16839 16840 16841 16842 16843 16844 16845 16846 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16839 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
16870 16871 16872 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16870 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
16849 16850 16851 16852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16849 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
16858 16859 16860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16858 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
16874 16875 16876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16874 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
16862 16863 16864 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16862 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
16866 16867 16868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16866 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
16878 16879 16880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16878 def to_hash value end |