Class: DSLParser
- Inherits:
-
Object
- Object
- DSLParser
- Defined in:
- lib/dbexpect/d_s_l_parser.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
Instance Method Summary collapse
- #expectation_tree ⇒ Object
-
#initialize ⇒ DSLParser
constructor
A new instance of DSLParser.
- #parse(script) ⇒ Object
- #tables ⇒ Object
Constructor Details
#initialize ⇒ DSLParser
Returns a new instance of DSLParser.
24 25 26 27 28 29 |
# File 'lib/dbexpect/d_s_l_parser.rb', line 24 def initialize @tables = {} @tree_nodes = [ExpectationTreeNode.new('->')] @files_loaded = Set.new @commands = [] end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
22 23 24 |
# File 'lib/dbexpect/d_s_l_parser.rb', line 22 def commands @commands end |
Instance Method Details
#expectation_tree ⇒ Object
31 32 33 |
# File 'lib/dbexpect/d_s_l_parser.rb', line 31 def expectation_tree @tree_nodes.first end |
#parse(script) ⇒ Object
35 36 37 |
# File 'lib/dbexpect/d_s_l_parser.rb', line 35 def parse(script) instance_eval(script) end |
#tables ⇒ Object
39 40 41 |
# File 'lib/dbexpect/d_s_l_parser.rb', line 39 def tables @tables.values end |