Class: ActiveAdmin::ActionItem

Inherits:
Object
  • Object
show all
Includes:
OptionalDisplay
Defined in:
lib/active_admin/resource/action_items.rb

Overview

Model class to store the data for ActionItems

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OptionalDisplay

#display_on?

Constructor Details

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

Returns a new instance of ActionItem.


104
105
106
107
108
109
# File 'lib/active_admin/resource/action_items.rb', line 104

def initialize(name, options = {}, &block)
  @name = name
  @options = options
  @block = block
  normalize_display_options!
end

Instance Attribute Details

#blockObject

Returns the value of attribute block


102
103
104
# File 'lib/active_admin/resource/action_items.rb', line 102

def block
  @block
end

#nameObject

Returns the value of attribute name


102
103
104
# File 'lib/active_admin/resource/action_items.rb', line 102

def name
  @name
end

Instance Method Details

#html_classObject


111
112
113
# File 'lib/active_admin/resource/action_items.rb', line 111

def html_class
  "action_item #{@options[:class]}".rstrip
end

#priorityObject


115
116
117
# File 'lib/active_admin/resource/action_items.rb', line 115

def priority
  @options[:priority] || 10
end