Class: EmailHelper::EmailBody
- Defined in:
- lib/watirmark/cucumber/email_helper.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#doc ⇒ Object
Returns the value of attribute doc.
Instance Method Summary collapse
-
#initialize(body) ⇒ EmailBody
constructor
A new instance of EmailBody.
- #inspect ⇒ Object
- #link(how, matcher) ⇒ Object
- #links ⇒ Object
Constructor Details
#initialize(body) ⇒ EmailBody
Returns a new instance of EmailBody.
104 105 106 107 |
# File 'lib/watirmark/cucumber/email_helper.rb', line 104 def initialize(body) @body = body @doc = ::Nokogiri::HTML.parse body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
102 103 104 |
# File 'lib/watirmark/cucumber/email_helper.rb', line 102 def body @body end |
#doc ⇒ Object
Returns the value of attribute doc.
102 103 104 |
# File 'lib/watirmark/cucumber/email_helper.rb', line 102 def doc @doc end |
Instance Method Details
#inspect ⇒ Object
131 132 133 |
# File 'lib/watirmark/cucumber/email_helper.rb', line 131 def inspect @doc.to_s end |
#link(how, matcher) ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/watirmark/cucumber/email_helper.rb', line 119 def link(how, matcher) links.each do |link| case how when :text return link if /#{matcher}/.matches link.text when :href return link if /#{matcher}/.matches link.href end end nil end |