Class: Mike::Document
- Inherits:
-
Object
- Object
- Mike::Document
- Defined in:
- lib/mike.rb
Overview
Env
Instance Attribute Summary collapse
-
#dom ⇒ Object
readonly
Returns the value of attribute dom.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#js ⇒ Object
readonly
Returns the value of attribute js.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ Document
constructor
A new instance of Document.
- #scripts ⇒ Object
Constructor Details
#initialize(url) ⇒ Document
Returns a new instance of Document.
17 18 19 20 21 22 23 24 25 |
# File 'lib/mike.rb', line 17 def initialize(url) @url = url @html = load_url(@url) @dom = Hpricot(@html) @js = Mustang::Context.new prepare_context process_scripts end |
Instance Attribute Details
#dom ⇒ Object (readonly)
Returns the value of attribute dom.
14 15 16 |
# File 'lib/mike.rb', line 14 def dom @dom end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
15 16 17 |
# File 'lib/mike.rb', line 15 def html @html end |
#js ⇒ Object (readonly)
Returns the value of attribute js.
12 13 14 |
# File 'lib/mike.rb', line 12 def js @js end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
13 14 15 |
# File 'lib/mike.rb', line 13 def url @url end |
Instance Method Details
#scripts ⇒ Object
27 28 29 |
# File 'lib/mike.rb', line 27 def scripts (@dom/"//script") end |