Class: Carnival::BatchAction

Inherits:
Action
  • Object
show all
Defined in:
app/models/carnival/batch_action.rb

Constant Summary

Constants inherited from Action

Action::PARTIAL_DEFAULT, Action::PARTIAL_DELETE, Action::PARTIAL_REMOTE

Instance Method Summary collapse

Methods inherited from Action

#data, #default_partial, #hidden?, #partial, #path, #remote?, #show, #target

Constructor Details

#initialize(presenter, name, params = {}) ⇒ BatchAction

Returns a new instance of BatchAction.



5
6
7
8
9
10
# File 'app/models/carnival/batch_action.rb', line 5

def initialize(presenter, name, params={})
  @presenter = presenter
  @name = name
  @params = params
  @path = params[:path] if params[:path].present?
end

Instance Method Details

#nameObject



16
17
18
# File 'app/models/carnival/batch_action.rb', line 16

def name
  @name
end

#paramsObject



12
13
14
# File 'app/models/carnival/batch_action.rb', line 12

def params
  @params
end

#to_labelObject



20
21
22
# File 'app/models/carnival/batch_action.rb', line 20

def to_label
  I18n.t("#{@presenter.model_name}.#{name}")
end