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.
22919 22920 22921 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22919 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
22917 22918 22919 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22917 def value @value end |
Class Method Details
.ALL ⇒ Object
22939 22940 22941 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22939 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
22924 22925 22926 22927 22928 22929 22930 22931 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22924 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
22955 22956 22957 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22955 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
22934 22935 22936 22937 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22934 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
22943 22944 22945 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22943 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
22959 22960 22961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22959 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
22947 22948 22949 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22947 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
22951 22952 22953 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22951 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
22963 22964 22965 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22963 def to_hash value end |