Module | Whois::Answer::Parser::Ast |
In: |
lib/whois/answer/parser/ast.rb
|
The Ast module tries to emulate a super-simple Abstract Syntax Tree structure including method for accessing ast nodes.
Include the Ast module and provide a parse instance method. parse should returns a Hash representing the AST.
def parse Scanner.new.parse end # => { "created_on" => "2009-12-12", ... }
Now you can access the AST using the node method.
node "created_on" # => "2009-12-12" node? "created_on" # => true node? "created_at" # => false