Class: Mechanize::Page::Frame
Overview
A Frame object wraps a frame HTML element. Frame objects can be treated just like Link objects. They contain #src, the #link they refer to and a #name, the name of the frame they refer to. #src and #name are aliased to #href and #text respectively so that a Frame object can be treated just like a Link.
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#text ⇒ Object
(also: #name)
readonly
Returns the value of attribute text.
Attributes inherited from Link
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(node, mech, referer) ⇒ Frame
constructor
A new instance of Frame.
Methods inherited from Link
#click, #dom_class, #dom_id, #noreferrer?, #pretty_print, #rel, #rel?, #resolved_uri, #uri
Constructor Details
#initialize(node, mech, referer) ⇒ Frame
Returns a new instance of Frame.
17 18 19 20 21 22 23 |
# File 'lib/mechanize/page/frame.rb', line 17 def initialize(node, mech, referer) super(node, mech, referer) @node = node @text = node['name'] @href = node['src'] @content = nil end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
15 16 17 |
# File 'lib/mechanize/page/frame.rb', line 15 def node @node end |
#text ⇒ Object (readonly) Also known as: name
Returns the value of attribute text.
12 13 14 |
# File 'lib/mechanize/page/frame.rb', line 12 def text @text end |
Instance Method Details
#content ⇒ Object
25 26 27 |
# File 'lib/mechanize/page/frame.rb', line 25 def content @content ||= @mech.get @href, [], page end |