Class: Orchparty::DSLParser

Inherits:
Object
  • Object
show all
Defined in:
lib/orchparty/dsl_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ DSLParser

Returns a new instance of DSLParser.



8
9
10
# File 'lib/orchparty/dsl_parser.rb', line 8

def initialize(filename)
  @filename = filename
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



6
7
8
# File 'lib/orchparty/dsl_parser.rb', line 6

def filename
  @filename
end

Instance Method Details

#parseObject



12
13
14
15
16
17
# File 'lib/orchparty/dsl_parser.rb', line 12

def parse
  file_content = File.read(filename)
  builder = RootBuilder.new
  builder.instance_eval(file_content, filename)
  builder._build
end