Class: Dapp::Dimg::Config::Directive::ArtifactBase

Inherits:
Base show all
Defined in:
lib/dapp/dimg/config/directive/artifact_base.rb

Direct Known Subclasses

Artifact, GitArtifactLocal

Defined Under Namespace

Classes: Export

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#clone_to_artifact

Methods inherited from Config::Directive::Base

#clone

Constructor Details

#initialize(**kwargs, &blk) ⇒ ArtifactBase

Returns a new instance of ArtifactBase.



8
9
10
11
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 8

def initialize(**kwargs, &blk)
  @_export = []
  super(**kwargs, &blk)
end

Instance Attribute Details

#_groupObject (readonly)

Returns the value of attribute _group.



6
7
8
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 6

def _group
  @_group
end

#_ownerObject (readonly)

Returns the value of attribute _owner.



6
7
8
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 6

def _owner
  @_owner
end

Instance Method Details

#_exportObject



27
28
29
30
31
32
33
34
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 27

def _export
  @_export.each do |export|
    export._owner ||= @_owner
    export._group ||= @_group

    yield(export) if block_given?
  end
end

#export(absolute_dir_path = nil, &blk) ⇒ Object



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

def export(absolute_dir_path = nil, &blk)
  self.class.const_get('Export').new(absolute_dir_path, dapp: dapp, &blk).tap do |export|
    @_export << export
  end
end

#group(group) ⇒ Object



17
18
19
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 17

def group(group)
  sub_directive_eval { @_group = group }
end

#owner(owner) ⇒ Object



13
14
15
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 13

def owner(owner)
  sub_directive_eval { @_owner = owner }
end