Class: Dill::TextField

Inherits:
Field show all
Defined in:
lib/dill/widgets/text_field.rb

Overview

A text field.

Constant Summary

Constants included from Dill

VERSION

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

Methods inherited from Field

root

Methods inherited from Widget

action, #class?, #classes, #click, filter, filter?, find_all_in, find_in, #has_action?, #hover, #html, #id, #initialize, not_present_in?, present_in?, root, selector, #text, #value, widget_delegator

Methods included from Widgets::DSL

#form, #list, #widget

Methods included from WidgetParts::Container

#has_widget?, #not_visible?, #visible?, #widget, #widgets

Methods included from Dill

#deprecate

Methods included from Constructors

#Decimal, #Integer, #Widget

Methods included from WidgetParts::Struct

included

Constructor Details

This class inherits a constructor from Dill::Widget

Instance Method Details

#content?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/dill/widgets/text_field.rb', line 23

def content?
  get.respond_to?(:empty?) ? ! get.empty? : !! get
end

#getObject

Returns The text field value.

Returns:

  • The text field value.



6
# File 'lib/dill/widgets/text_field.rb', line 6

def_delegator :root, :value, :get

#set(value) ⇒ Object

Sets the text field value.

Parameters:

  • value (String)

    the value to set.



12
# File 'lib/dill/widgets/text_field.rb', line 12

def_delegator :root, :set

#to_cellObject



19
20
21
# File 'lib/dill/widgets/text_field.rb', line 19

def to_cell
  get
end

#to_sObject

Returns the text field value, or the empty string if the field is empty.

Returns:

  • the text field value, or the empty string if the field is empty.



17
# File 'lib/dill/widgets/text_field.rb', line 17

def_delegator :get, :to_s