Class: Dill::Field

Inherits:
Widget show all
Defined in:
lib/dill/widgets/field.rb

Overview

A form field.

Direct Known Subclasses

CheckBox, Select, TextField

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Widget

#absent?, action, #click, #diff, #gone?, #has_action?, #initialize, #inspect, #present?, root, #root, selector, #text, #to_cell, #to_s, #value, widget, widget_delegator

Methods included from WidgetParts::Container

#has_no_widget?, #has_widget?, #widget

Methods included from WidgetParts::Struct

included

Constructor Details

This class inherits a constructor from Dill::Widget

Class Method Details

.find_in(parent) ⇒ Object



4
5
6
# File 'lib/dill/widgets/field.rb', line 4

def self.find_in(parent)
  new { parent.root.find_field(*selector) }
end

.present_in?(parent) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/dill/widgets/field.rb', line 8

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

Instance Method Details

#getObject

Override this to get the actual value.

Returns:

  • This field’s value.

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/dill/widgets/field.rb', line 15

def get
  raise NotImplementedError
end

#set(value) ⇒ Object

Sets the field value.

Override this to set the value.

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/dill/widgets/field.rb', line 22

def set(value)
  raise NotImplementedError
end