Class: Automux::Controller::Base

Inherits:
Object
  • Object
show all
Extended by:
Support::Filters
Includes:
Support::Rendering
Defined in:
lib/automux/controller/base.rb

Direct Known Subclasses

Blueprints, Messages, Recipes, Setup

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::Filters

after_inherited, before_filter, inherited

Methods included from Support::Rendering

#render

Constructor Details

#initialize(params = {}) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/automux/controller/base.rb', line 9

def initialize(params = {})
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/automux/controller/base.rb', line 7

def params
  @params
end

Instance Method Details

#check_blueprintObject



17
18
19
# File 'lib/automux/controller/base.rb', line 17

def check_blueprint
  notify_error "Unable to find blueprint named #{ params[:blueprint_name] }.yml" if @blueprint.nil?
end

#notify_error(message) ⇒ Object



13
14
15
# File 'lib/automux/controller/base.rb', line 13

def notify_error(message)
  Automux::Controller::Messages.new(message: message).error
end