Class: Io::Flow::V0::Models::EmailRecipient
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::EmailRecipient
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ EmailRecipient
constructor
A new instance of EmailRecipient.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ EmailRecipient
Returns a new instance of EmailRecipient.
31266 31267 31268 31269 31270 31271 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31266 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:email], 'EmailRecipient') @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String) @name = (x = opts.delete(:name); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))) end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
31264 31265 31266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31264 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31264 31265 31266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31264 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31277 31278 31279 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31277 def copy(incoming={}) EmailRecipient.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31281 31282 31283 31284 31285 31286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31281 def to_hash { :email => email, :name => name.nil? ? nil : name.to_hash } end |
#to_json ⇒ Object
31273 31274 31275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31273 def to_json JSON.dump(to_hash) end |