Class: AethernalAgent::Docker::Volume
- Inherits:
-
Object
- Object
- AethernalAgent::Docker::Volume
- Defined in:
- lib/aethernal_agent/docker/volume.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, target) ⇒ Volume
constructor
A new instance of Volume.
- #to_docker ⇒ Object
Constructor Details
#initialize(source, target) ⇒ Volume
Returns a new instance of Volume.
5 6 7 8 |
# File 'lib/aethernal_agent/docker/volume.rb', line 5 def initialize(source, target) self.source = source self.target = target end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/aethernal_agent/docker/volume.rb', line 4 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
4 5 6 |
# File 'lib/aethernal_agent/docker/volume.rb', line 4 def target @target end |
Class Method Details
.create_from_options(manifest_options, opts) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/aethernal_agent/docker/volume.rb', line 10 def self.(, opts) volumes = [] .each do |k,v| if v.present? if v["docker"].present? && v["docker"]["volume"].present? volumes << Volume.new(opts[k], v["docker"]["volume"]) end end end return volumes end |
Instance Method Details
#to_docker ⇒ Object
23 24 25 |
# File 'lib/aethernal_agent/docker/volume.rb', line 23 def to_docker "#{self.source}:#{self.target}" end |