Class: ObjectView::TextArea

Inherits:
Element
  • Object
show all
Defined in:
lib/object_view/input.rb

Instance Attribute Summary

Attributes inherited from Element

#acceptable_children, #children, #single_line, #tag

Instance Method Summary collapse

Methods inherited from Element

#<<, #add, #add_with_tag, #attr, #attributes, #css_class=, #find_element_with_tag, #id=, #is_acceptable_child?, #on_click=, #render, #render_attributes, #render_children, #style, #style=

Constructor Details

#initialize(value = "") ⇒ TextArea

Returns a new instance of TextArea.



7
8
9
10
11
# File 'lib/object_view/input.rb', line 7

def initialize(value = "")
  super()
  @tag = "textarea"
  
end

Instance Method Details

#columns=(count) ⇒ Object



17
18
19
# File 'lib/object_view/input.rb', line 17

def columns= count
  self.attr('cols', row_count.to_s)
end

#rows=(row_count) ⇒ Object



13
14
15
# File 'lib/object_view/input.rb', line 13

def rows= row_count
  self.attr('rows', row_count.to_s)
end

#value=(text) ⇒ Object



21
22
23
24
# File 'lib/object_view/input.rb', line 21

def value= text
  self.children.clear if (self.children)
  self.add text
end