Class: Dapp::Dimg::Config::Directive::Dimg::InstanceMethods::GitArtifact
- Inherits:
-
Base
- Object
- Config::Directive::Base
- Base
- Dapp::Dimg::Config::Directive::Dimg::InstanceMethods::GitArtifact
- Defined in:
- lib/dapp/dimg/config/directive/dimg/instance_methods.rb
Instance Attribute Summary collapse
-
#_local ⇒ Object
readonly
Returns the value of attribute _local.
-
#_remote ⇒ Object
readonly
Returns the value of attribute _remote.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(**kwargs, &blk) ⇒ GitArtifact
constructor
A new instance of GitArtifact.
- #local(_, &blk) ⇒ Object
- #remote(repo_url, &blk) ⇒ Object
- #validate! ⇒ Object
Methods inherited from Base
Methods inherited from Config::Directive::Base
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
#_local ⇒ Object (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 |
#_remote ⇒ Object (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
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 |