Class: Caterer::Action::Config::Validate::Image

Inherits:
Base
  • Object
show all
Defined in:
lib/caterer/action/config/validate/image.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Caterer::Action::Base

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/caterer/action/config/validate/image.rb', line 7

def call(env)

  if env[:image]
    # check to ensure the image exists
    image = env[:config].images[env[:image]]

    if not image
      env[:ui].error "image ':#{env[:image]}' is not defined"
      return
    end              
  end

  @app.call(env)
end