Class: PageObjectify::DOMToRuby
- Inherits:
-
Object
- Object
- PageObjectify::DOMToRuby
- Defined in:
- lib/page-objectify/dom_to_ruby.rb
Overview
Takes an Array of DOM elements and generates Ruby code (page class containing PageObject::Accessors)
Instance Method Summary collapse
-
#initialize(dom, config) ⇒ DOMToRuby
constructor
A new instance of DOMToRuby.
-
#unparse ⇒ Object
Generate Ruby source as a String.
Methods included from Logging
Methods included from ASTMaker
Constructor Details
#initialize(dom, config) ⇒ DOMToRuby
Returns a new instance of DOMToRuby.
13 14 15 16 |
# File 'lib/page-objectify/dom_to_ruby.rb', line 13 def initialize(dom, config) @dom = dom @config = config end |
Instance Method Details
#unparse ⇒ Object
Generate Ruby source as a String
19 20 21 22 23 24 25 |
# File 'lib/page-objectify/dom_to_ruby.rb', line 19 def unparse tree = s(:class, *first_line, s(:begin, *accessors) ) Unparser.unparse(tree) end |