Class: Rbml::Base

Inherits:
Object
  • Object
show all
Includes:
Primitives
Defined in:
lib/base.rb

Direct Known Subclasses

Cli, Doc, Procedural, Shell

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language = nil) ⇒ Base

Returns a new instance of Base.



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

def initialize(language=nil)
  @dsl = BlankSlate.new(language)
end

Instance Attribute Details

#dslObject

Returns the value of attribute dsl.



4
5
6
# File 'lib/base.rb', line 4

def dsl
  @dsl
end

Instance Method Details

#instance_eval_each(code, &blk) ⇒ Object



10
11
12
13
14
15
# File 'lib/base.rb', line 10

def instance_eval_each(code, &blk)
  $breaker = BlockBreaker.new do |name, args, block|
    yield @dsl.__send__(name, *args, &block)
  end
  $breaker.__instance_eval__ &code
end