Class: Algo::Cli::ServiceValidator
- Inherits:
-
Object
- Object
- Algo::Cli::ServiceValidator
- Defined in:
- lib/algo/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(srv_spec) ⇒ ServiceValidator
constructor
A new instance of ServiceValidator.
- #validate ⇒ Object
Constructor Details
#initialize(srv_spec) ⇒ ServiceValidator
Returns a new instance of ServiceValidator.
6 7 8 |
# File 'lib/algo/cli.rb', line 6 def initialize srv_spec @srv_spec = srv_spec end |
Class Method Details
.validate(srv_spec) ⇒ Object
19 20 21 |
# File 'lib/algo/cli.rb', line 19 def self.validate srv_spec new(srv_spec).validate end |
Instance Method Details
#validate ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/algo/cli.rb', line 10 def validate begin @srv = Algo::Docker::Service.find(@srv_spec['Name']) rescue Algo::Docker::Error::NotFoundError @srv = nil end check_networks end |