Class: Dapp::Dimg::Config::Directive::Dimg::InstanceMethods::GitArtifact

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#clone_to_artifact

Methods inherited from Config::Directive::Base

#clone, #encode_with

Constructor Details

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

Returns a new instance of GitArtifact.



110
111
112
113
114
115
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 110

def initialize(**kwargs, &blk)
  @_local = []
  @_remote = []

  super(**kwargs, &blk)
end

Instance Attribute Details

#_localObject (readonly)

Returns the value of attribute _local.



108
109
110
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 108

def _local
  @_local
end

#_remoteObject (readonly)

Returns the value of attribute _remote.



108
109
110
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 108

def _remote
  @_remote
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 137

def empty?
  (_local + _remote).empty?
end

#local(_, &blk) ⇒ Object



117
118
119
120
121
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 117

def local(_, &blk)
  GitArtifactLocal.new(dapp: dapp, &blk).tap do |git|
    @_local << git
  end
end

#remote(repo_url, &blk) ⇒ Object



123
124
125
126
127
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 123

def remote(repo_url, &blk)
  GitArtifactRemote.new(repo_url, dapp: dapp, &blk).tap do |git|
    @_remote << git
  end
end

#validate!Object



141
142
143
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 141

def validate!
  (_local + _remote).each(&:validate!)
end