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.



114
115
116
117
118
# File 'lib/ab_admin/config/base.rb', line 114

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

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



112
113
114
# File 'lib/ab_admin/config/base.rb', line 112

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



112
113
114
# File 'lib/ab_admin/config/base.rb', line 112

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



112
113
114
# File 'lib/ab_admin/config/base.rb', line 112

def options
  @options
end

Instance Method Details

#dataObject



120
121
122
# File 'lib/ab_admin/config/base.rb', line 120

def data
  @block || name.to_sym
end

#group?Boolean

Returns:

  • (Boolean)


124
125
126
# File 'lib/ab_admin/config/base.rb', line 124

def group?
  false
end