Class: Vagrant::LXC::Action::Message
- Inherits:
-
Object
- Object
- Vagrant::LXC::Action::Message
- Defined in:
- lib/vagrant-lxc/action/message.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env, msg_key, type = :info) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(app, env, msg_key, type = :info) ⇒ Message
Returns a new instance of Message.
5 6 7 8 9 |
# File 'lib/vagrant-lxc/action/message.rb', line 5 def initialize(app, env, msg_key, type = :info) @app = app @msg_key = msg_key @type = type end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/vagrant-lxc/action/message.rb', line 11 def call(env) machine = env[:machine] = I18n.t("vagrant_lxc.messages.#{@msg_key}", name: machine.name) env[:ui].send @type, @app.call env end |