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.



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

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

Instance Attribute Details

#block ⇒ Object (readonly)

Returns the value of attribute block.



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

def block
  @block
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#options ⇒ Object (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#data ⇒ Object



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

def data
  @block || name.to_sym
end

#group? ⇒ Boolean

Returns:

  • (Boolean)


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

def group?
  false
end