Class: Marathon::ContainerVolume
- Defined in:
- lib/marathon/container_volume.rb
Overview
This class represents a Marathon Container Volume information. See mesosphere.github.io/marathon/docs/native-docker.html for full details.
Constant Summary collapse
- ACCESSORS =
%w[ containerPath hostPath mode ]
- DEFAULTS =
{ :mode => 'RW' }
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(hash) ⇒ ContainerVolume
constructor
Create a new container volume object.
- #to_pretty_s ⇒ Object
- #to_s ⇒ Object
Methods inherited from Base
Methods included from Error
error_class, error_message, from_response
Constructor Details
#initialize(hash) ⇒ ContainerVolume
Create a new container volume object. hash
: Hash returned by API.
12 13 14 15 16 |
# File 'lib/marathon/container_volume.rb', line 12 def initialize(hash) super(Marathon::Util.merge_keywordized_hash(DEFAULTS, hash), ACCESSORS) Marathon::Util.validate_choice('mode', mode, %w[RW RO]) raise Marathon::Error::ArgumentError, 'containerPath must not be nil' unless containerPath end |
Instance Method Details
#to_pretty_s ⇒ Object
18 19 20 |
# File 'lib/marathon/container_volume.rb', line 18 def to_pretty_s "#{containerPath}:#{hostPath}:#{mode}" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/marathon/container_volume.rb', line 22 def to_s "Marathon::ContainerVolume { :containerPath => #{containerPath} :hostPath => #{hostPath} :mode => #{mode} }" end |