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.
14912 14913 14914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14912 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14910 14911 14912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14910 def value @value end |
Class Method Details
.ALL ⇒ Object
14932 14933 14934 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14932 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
14917 14918 14919 14920 14921 14922 14923 14924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14917 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
14948 14949 14950 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14948 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
14927 14928 14929 14930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14927 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
14936 14937 14938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14936 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
14952 14953 14954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14952 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
14940 14941 14942 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14940 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
14944 14945 14946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14944 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
14956 14957 14958 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14956 def to_hash value end |