Class: Dill::FieldGroup::Field

Inherits:
Widget
  • Object
show all
Defined in:
lib/dill/field_group.rb

Overview

A form field.

Direct Known Subclasses

CheckBox, Select, TextField

Instance Attribute Summary

Attributes inherited from Widget

#root

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Widget

#!=, #==, action, #has_action?, #initialize, #inspect, #reload, root, selector, #to_f, #to_i, #to_s, widget, widget_delegator

Methods included from WidgetContainer

#has_widget?, #widget

Constructor Details

This class inherits a constructor from Dill::Widget

Class Method Details

.find_in(parent, options) ⇒ Object



247
248
249
# File 'lib/dill/field_group.rb', line 247

def self.find_in(parent, options)
  new({root: parent.find_field(selector)}.merge(options))
end

.present_in?(parent) ⇒ Boolean

Returns:

  • (Boolean)


251
252
253
# File 'lib/dill/field_group.rb', line 251

def self.present_in?(parent)
  parent.has_field?(selector)
end

Instance Method Details

#getObject

Override this to get the actual value.

Returns:

  • This field’s value.

Raises:

  • (NotImplementedError)


258
259
260
# File 'lib/dill/field_group.rb', line 258

def get
  raise NotImplementedError
end

#set(value) ⇒ Object

Sets the field value.

Override this to set the value.

Raises:

  • (NotImplementedError)


265
266
267
# File 'lib/dill/field_group.rb', line 265

def set(value)
  raise NotImplementedError
end