Class: AbAdmin::Config::BatchAction

Inherits:
Object
  • Object
show all
Defined in:
lib/ab_admin/config/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}, &block) ⇒ BatchAction

Returns a new instance of BatchAction



115
116
117
118
119
120
121
122
123
# File 'lib/ab_admin/config/base.rb', line 115

def initialize(name, options={}, &block)
  @name = name
  @options = options
  if options.has_key?(:form)
    @form = options[:form].is_a?(String) ? options[:form] : "##{name}_batch_form"
  end
  @title = options[:title] || I18n.t("admin.actions.batch_#{name}.link", default: name.to_s.humanize)
  @data = block_given? ? block : name.to_sym
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data



113
114
115
# File 'lib/ab_admin/config/base.rb', line 113

def data
  @data
end

#formObject (readonly)

Returns the value of attribute form



113
114
115
# File 'lib/ab_admin/config/base.rb', line 113

def form
  @form
end

#nameObject (readonly)

Returns the value of attribute name



113
114
115
# File 'lib/ab_admin/config/base.rb', line 113

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options



113
114
115
# File 'lib/ab_admin/config/base.rb', line 113

def options
  @options
end

#titleObject (readonly)

Returns the value of attribute title



113
114
115
# File 'lib/ab_admin/config/base.rb', line 113

def title
  @title
end

Instance Method Details

#confirmObject



125
126
127
# File 'lib/ab_admin/config/base.rb', line 125

def confirm
  options[:confirm]
end