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.
14928 14929 14930 14931 14932 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14928 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.
14926 14927 14928 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14926 def token @token end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
14938 14939 14940 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14938 def copy(incoming={}) ValidationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
14942 14943 14944 14945 14946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14942 def to_hash { :token => token } end |
#to_json ⇒ Object
14934 14935 14936 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14934 def to_json JSON.dump(to_hash) end |