Class: Resulang::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/resulang/dsl.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Dsl

Returns a new instance of Dsl.



9
10
11
12
# File 'lib/resulang/dsl.rb', line 9

def initialize(path)
  @path    = path
  @resume = Resume.new
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/resulang/dsl.rb', line 3

def path
  @path
end

Class Method Details

.register_section!(section, klass) ⇒ Object



5
6
7
# File 'lib/resulang/dsl.rb', line 5

def self.register_section!(section, klass)
  define_section_method(section, klass)
end

Instance Method Details

#resumeObject



14
15
16
17
18
19
20
21
# File 'lib/resulang/dsl.rb', line 14

def resume
  unless @evaluated
    instance_eval(File.read(path))
    @evaluated = true
  end

  @resume
end