Class: Io::Flow::V0::Models::EmailNotificationForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::EmailNotificationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ EmailNotificationForm
constructor
A new instance of EmailNotificationForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ EmailNotificationForm
Returns a new instance of EmailNotificationForm.
40908 40909 40910 40911 40912 40913 40914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40908 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:to, :created_at, :data], 'EmailNotificationForm') @to = (x = opts.delete(:to); x.is_a?(::Io::Flow::V0::Models::EmailRecipient) ? x : ::Io::Flow::V0::Models::EmailRecipient.new(x)) @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) @data = (x = opts.delete(:data); x.is_a?(::Io::Flow::V0::Models::EmailNotificationData) ? x : ::Io::Flow::V0::Models::EmailNotificationData.from_json(x)) end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
40906 40907 40908 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40906 def created_at @created_at end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
40906 40907 40908 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40906 def data @data end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
40906 40907 40908 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40906 def to @to end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40920 40921 40922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40920 def copy(incoming={}) EmailNotificationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40924 40925 40926 40927 40928 40929 40930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40924 def to_hash { :to => to.to_hash, :created_at => created_at, :data => data.to_hash } end |
#to_json ⇒ Object
40916 40917 40918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40916 def to_json JSON.dump(to_hash) end |