Class: Webspicy::Tester::Fakesendgrid::Email
- Inherits:
-
Object
- Object
- Webspicy::Tester::Fakesendgrid::Email
- Defined in:
- lib/webspicy/tester/fakesendgrid/email.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #from ⇒ Object
-
#initialize(data) ⇒ Email
constructor
A new instance of Email.
- #subject ⇒ Object
- #to ⇒ Object
Constructor Details
#initialize(data) ⇒ Email
Returns a new instance of Email.
6 7 8 |
# File 'lib/webspicy/tester/fakesendgrid/email.rb', line 6 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/webspicy/tester/fakesendgrid/email.rb', line 9 def data @data end |
Instance Method Details
#from ⇒ Object
11 12 13 |
# File 'lib/webspicy/tester/fakesendgrid/email.rb', line 11 def from @from ||= data["from"]["email"] end |
#subject ⇒ Object
22 23 24 |
# File 'lib/webspicy/tester/fakesendgrid/email.rb', line 22 def subject @subject ||= data["subject"] end |
#to ⇒ Object
15 16 17 18 19 20 |
# File 'lib/webspicy/tester/fakesendgrid/email.rb', line 15 def to @to ||= data["personalizations"] .select{|h| h.key? "to" } .map{|(h)| h["to"] } .map{|(h)| h["email"] } end |