Class: AbAdmin::Config::CustomAction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OptionalDisplay

#for_action?, #for_context?

Constructor Details

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


143
144
145
146
147
148
149
# File 'lib/ab_admin/config/base.rb', line 143

def initialize(name, options={}, &block)
  raise 'Can not create member action without a block' unless block_given?
  @name = name
  @options = options
  @data = block
  normalize_display_options!
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data


141
142
143
# File 'lib/ab_admin/config/base.rb', line 141

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name


141
142
143
# File 'lib/ab_admin/config/base.rb', line 141

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options


141
142
143
# File 'lib/ab_admin/config/base.rb', line 141

def options
  @options
end

Instance Method Details

#collection?Boolean


151
152
153
# File 'lib/ab_admin/config/base.rb', line 151

def collection?
  options[:collection]
end