The Scannable module tries to emulate a super-simple Abstract Syntax Tree structure including method for accessing ast nodes.
Include the Scannable module and set the `self.scanner` value.
class ParserFoo include Scannable self.scanner = ScannerFoo end
Now you can access the AST using the node method.
node "created_on" # => "2009-12-12" node? "created_on" # => true node? "created_at" # => false
# File lib/whois/record/scanners/scannable.rb, line 47 def node(key) if block_given? value = ast[key] value = yield(value) unless value.nil? value else ast[key] end end
Generated with the Darkfish Rdoc Generator 2.