Class: Mechanize::Page::Frame
Overview
A Frame object wrapse 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
-
#text ⇒ Object
(also: #name)
readonly
Returns the value of attribute text.
Attributes inherited from Link
#attributes, #href, #node, #page
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, #pretty_print, #rel, #rel?, #uri
Constructor Details
#initialize(node, mech, referer) ⇒ Frame
Returns a new instance of Frame.
14 15 16 17 18 19 20 |
# File 'lib/mechanize/page/frame.rb', line 14 def initialize(node, mech, referer) super(node, mech, referer) @node = node @text = node['name'] @href = node['src'] @content = nil end |
Instance Attribute Details
#text ⇒ Object (readonly) Also known as: name
Returns the value of attribute text.
11 12 13 |
# File 'lib/mechanize/page/frame.rb', line 11 def text @text end |
Instance Method Details
#content ⇒ Object
22 23 24 |
# File 'lib/mechanize/page/frame.rb', line 22 def content @content ||= @mech.get @href, [], page end |