Class: AdminWidgets::ListWidget::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/admin_widgets/list_widget.rb

Overview

Helper classes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, name, options, value_callback) ⇒ Field

Returns a new instance of Field.



146
147
148
# File 'lib/admin_widgets/list_widget.rb', line 146

def initialize(parent, name, options, value_callback)
  @parent, @name, @options, @value_callback = parent, name, options, value_callback
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



144
145
146
# File 'lib/admin_widgets/list_widget.rb', line 144

def name
  @name
end

#optionsObject

Returns the value of attribute options.



144
145
146
# File 'lib/admin_widgets/list_widget.rb', line 144

def options
  @options
end

#parentObject

Returns the value of attribute parent.



144
145
146
# File 'lib/admin_widgets/list_widget.rb', line 144

def parent
  @parent
end

#value_callbackObject

Returns the value of attribute value_callback.



144
145
146
# File 'lib/admin_widgets/list_widget.rb', line 144

def value_callback
  @value_callback
end

Instance Method Details

#value_for(object) ⇒ Object



150
151
152
# File 'lib/admin_widgets/list_widget.rb', line 150

def value_for(object)
  object.instance_exec(name, options, &value_callback)
end