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

Returns a new instance of CustomAction


148
149
150
151
152
153
154
# File 'lib/ab_admin/config/base.rb', line 148

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


146
147
148
# File 'lib/ab_admin/config/base.rb', line 146

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name


146
147
148
# File 'lib/ab_admin/config/base.rb', line 146

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options


146
147
148
# File 'lib/ab_admin/config/base.rb', line 146

def options
  @options
end

Instance Method Details

#collection?Boolean

Returns:

  • (Boolean)

156
157
158
# File 'lib/ab_admin/config/base.rb', line 156

def collection?
  options[:collection]
end