Class: Dapp::Dimg::Config::DimgGroupBase
- Inherits:
-
Base
- Object
- Config::Base
- Base
- Dapp::Dimg::Config::DimgGroupBase
- Defined in:
- lib/dapp/dimg/config/dimg_group_base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#_dimg_group ⇒ Object
readonly
Returns the value of attribute _dimg_group.
Instance Method Summary collapse
- #_dimg ⇒ Object
- #dev_mode ⇒ Object
- #dimg(name = nil, &blk) ⇒ Object
- #dimg_group(&blk) ⇒ Object
-
#initialize(dapp:) ⇒ DimgGroupBase
constructor
A new instance of DimgGroupBase.
Constructor Details
#initialize(dapp:) ⇒ DimgGroupBase
Returns a new instance of DimgGroupBase.
7 8 9 10 11 12 |
# File 'lib/dapp/dimg/config/dimg_group_base.rb', line 7 def initialize(dapp:) @_dimg = [] @_dimg_group = [] super(dapp: dapp) end |
Instance Attribute Details
#_dimg_group ⇒ Object (readonly)
Returns the value of attribute _dimg_group.
5 6 7 |
# File 'lib/dapp/dimg/config/dimg_group_base.rb', line 5 def _dimg_group @_dimg_group end |
Instance Method Details
#_dimg ⇒ Object
34 35 36 |
# File 'lib/dapp/dimg/config/dimg_group_base.rb', line 34 def _dimg (@_dimg + @_dimg_group.map(&:_dimg)).flatten end |
#dev_mode ⇒ Object
14 15 16 |
# File 'lib/dapp/dimg/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/dimg/config/dimg_group_base.rb', line 18 def dimg(name = nil, &blk) Config::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
26 27 28 29 30 31 32 |
# File 'lib/dapp/dimg/config/dimg_group_base.rb', line 26 def dimg_group(&blk) Config::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 |