Class: Aurita::GUI::Textarea_Field

Inherits:
Form_Field show all
Defined in:
lib/aurita-gui/form/textarea_field.rb

Instance Attribute Summary

Attributes inherited from Form_Field

#form, #label, #type, #value

Attributes inherited from Element

#attrib, #content, #parent, #tag, #type

Instance Method Summary collapse

Methods inherited from Form_Field

#disable!, #editable!, #enable!, #readonly!, #readonly?, #readonly_element, #to_s

Methods inherited from Element

#+, #[], #[]=, #clear_floating, #dom_id, #dom_id=, #each, #empty?, #id, #id=, #length, #method_missing, #string, #to_ary

Constructor Details

#initialize(params, &block) ⇒ Textarea_Field

Returns a new instance of Textarea_Field.



8
9
10
11
12
13
14
15
# File 'lib/aurita-gui/form/textarea_field.rb', line 8

def initialize(params, &block)
  params[:tag] = :textarea
  # Move value parameter to @content: 
  @content     = params[:value]
  params.delete(:value)
  super(params, &block)
  @value       = @content
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aurita::GUI::Element

Instance Method Details

#elementObject



16
17
18
# File 'lib/aurita-gui/form/textarea_field.rb', line 16

def element
  HTML.textarea(@attrib) { @value }
end