Class: Dapp::Config::DimgGroupBase

Inherits:
Base
  • Object
show all
Defined in:
lib/dapp/config/dimg_group_base.rb

Overview

DimgGroupBase

Direct Known Subclasses

DimgGroup, DimgGroupMain

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project:) ⇒ DimgGroupBase

Returns a new instance of DimgGroupBase.



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

def initialize(project:)
  @_dimg = []
  @_dimg_group = []

  super(project: project)
end

Instance Attribute Details

#_dimg_groupObject (readonly)

Returns the value of attribute _dimg_group.



5
6
7
# File 'lib/dapp/config/dimg_group_base.rb', line 5

def _dimg_group
  @_dimg_group
end

Instance Method Details

#_dimgObject



34
35
36
# File 'lib/dapp/config/dimg_group_base.rb', line 34

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

#dev_modeObject



14
15
16
# File 'lib/dapp/config/dimg_group_base.rb', line 14

def dev_mode
  @_dev_mode = true
end

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



18
19
20
21
22
23
24
# File 'lib/dapp/config/dimg_group_base.rb', line 18

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

#dimg_group(&blk) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/dapp/config/dimg_group_base.rb', line 26

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