Class: Io::Flow::V0::Models::OptinResponse
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OptinResponse
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OptinResponse
constructor
A new instance of OptinResponse.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OptinResponse
Returns a new instance of OptinResponse.
35084 35085 35086 35087 35088 35089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35084 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :value], 'OptinResponse') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::OptinResponseType) ? x : ::Io::Flow::V0::Models::OptinResponseType.apply(x)) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
35082 35083 35084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35082 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
35082 35083 35084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35082 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
35095 35096 35097 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35095 def copy(incoming={}) OptinResponse.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
35099 35100 35101 35102 35103 35104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35099 def to_hash { :key => key, :value => value.value } end |
#to_json ⇒ Object
35091 35092 35093 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35091 def to_json JSON.dump(to_hash) end |