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.
14924 14925 14926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14924 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14922 14923 14924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14922 def value @value end |
Class Method Details
.ALL ⇒ Object
14944 14945 14946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14944 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
14929 14930 14931 14932 14933 14934 14935 14936 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14929 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
14960 14961 14962 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14960 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
14939 14940 14941 14942 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14939 def PermittedHttpMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PermittedHttpMethod.ALL.find { |v| v.value == value } end |
.get ⇒ Object
14948 14949 14950 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14948 def PermittedHttpMethod.get @@_get ||= PermittedHttpMethod.new('GET') end |
.patch ⇒ Object
14964 14965 14966 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14964 def PermittedHttpMethod.patch @@_patch ||= PermittedHttpMethod.new('PATCH') end |
.post ⇒ Object
14952 14953 14954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14952 def PermittedHttpMethod.post @@_post ||= PermittedHttpMethod.new('POST') end |
.put ⇒ Object
14956 14957 14958 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14956 def PermittedHttpMethod.put @@_put ||= PermittedHttpMethod.new('PUT') end |
Instance Method Details
#to_hash ⇒ Object
14968 14969 14970 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14968 def to_hash value end |