Class: RakeDocker::Container::Destroyer
- Inherits:
-
Object
- Object
- RakeDocker::Container::Destroyer
- Includes:
- Utilities
- Defined in:
- lib/rake_docker/container.rb
Overview
rubocop:enable Metrics/ClassLength
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name, opts = {}) ⇒ Destroyer
constructor
A new instance of Destroyer.
Methods included from Utilities
#enhance_with_name, #find_container
Constructor Details
#initialize(name, opts = {}) ⇒ Destroyer
Returns a new instance of Destroyer.
276 277 278 279 |
# File 'lib/rake_docker/container.rb', line 276 def initialize(name, opts = {}) @name = name @reporter = opts[:reporter] || NullReporter.new end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
274 275 276 |
# File 'lib/rake_docker/container.rb', line 274 def name @name end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
274 275 276 |
# File 'lib/rake_docker/container.rb', line 274 def reporter @reporter end |
Instance Method Details
#execute ⇒ Object
281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/rake_docker/container.rb', line 281 def execute reporter.checking_if_container_exists(name) container = find_container(name) if container reporter.container_exists(container) destroy_container(container) else reporter.container_does_not_exist(name) end reporter.done end |