class Webspicy::Tester::Fakesendgrid
Constants
- DEFAULT_OPTIONS
Attributes
options[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/webspicy/tester/fakesendgrid.rb, line 10 def initialize(options = {}) @options = DEFAULT_OPTIONS.merge(options) end
Public Instance Methods
clear!()
click to toggle source
# File lib/webspicy/tester/fakesendgrid.rb, line 19 def clear! res = HTTP.delete("#{endpoint}/api/mails") end
emails()
click to toggle source
# File lib/webspicy/tester/fakesendgrid.rb, line 23 def emails res = HTTP.get("#{endpoint}/api/mails") JSON.parse(res.body).map{|data| Email.new(data) } end
emails_count()
click to toggle source
# File lib/webspicy/tester/fakesendgrid.rb, line 28 def emails_count emails.length end
endpoint()
click to toggle source
# File lib/webspicy/tester/fakesendgrid.rb, line 15 def endpoint options[:endpoint] end
last_email()
click to toggle source
# File lib/webspicy/tester/fakesendgrid.rb, line 32 def last_email emails.first end