Class: AbAdmin::Config::Field

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) ⇒ Field

Returns a new instance of Field.



98
99
100
101
102
# File 'lib/ab_admin/config/base.rb', line 98

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

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



96
97
98
# File 'lib/ab_admin/config/base.rb', line 96

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



96
97
98
# File 'lib/ab_admin/config/base.rb', line 96

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



96
97
98
# File 'lib/ab_admin/config/base.rb', line 96

def options
  @options
end

Instance Method Details

#dataObject



104
105
106
# File 'lib/ab_admin/config/base.rb', line 104

def data
  @block || name.to_sym
end

#group?Boolean

Returns:

  • (Boolean)


108
109
110
# File 'lib/ab_admin/config/base.rb', line 108

def group?
  false
end