Class: Io::Flow::V0::Models::ValidationForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ValidationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Defines the payload of a request to validate a token, with primary goal of preventing the token from being included in an HTTP GET.
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ValidationForm
constructor
A new instance of ValidationForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ValidationForm
Returns a new instance of ValidationForm.
16783 16784 16785 16786 16787 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16783 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:token], 'ValidationForm') @token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String) end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
16781 16782 16783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16781 def token @token end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16793 16794 16795 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16793 def copy(incoming={}) ValidationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16797 16798 16799 16800 16801 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16797 def to_hash { :token => token } end |
#to_json ⇒ Object
16789 16790 16791 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16789 def to_json JSON.dump(to_hash) end |