Module: Dapp::Dimg::Config::Directive::DimgGroupBase

Included in:
DimgGroup
Defined in:
lib/dapp/dimg/config/directive/dimg_group_base.rb

Instance Method Summary collapse

Instance Method Details

#_dimgObject



22
23
24
# File 'lib/dapp/dimg/config/directive/dimg_group_base.rb', line 22

def _dimg
  (@_dimg + @_dimg_group.map(&:_dimg)).flatten
end

#_dimg_groupObject



26
27
28
# File 'lib/dapp/dimg/config/directive/dimg_group_base.rb', line 26

def _dimg_group
  @_dimg_group
end

#dimg(name = nil, &blk) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/dapp/dimg/config/directive/dimg_group_base.rb', line 6

def dimg(name = nil, &blk)
  Dimg.new(name, dapp: dapp).tap do |dimg|
    before_dimg_eval(dimg)
    dimg.instance_eval(&blk) if block_given?
    @_dimg << dimg
  end
end

#dimg_group(&blk) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/dapp/dimg/config/directive/dimg_group_base.rb', line 14

def dimg_group(&blk)
  DimgGroup.new(dapp: dapp).tap do |dimg_group|
    before_dimg_group_eval(dimg_group)
    dimg_group.instance_eval(&blk) if block_given?
    @_dimg_group << dimg_group
  end
end