Class: ObjectView::Input

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

#initializeInput

Returns a new instance of Input.



29
30
31
32
# File 'lib/object_view/input.rb', line 29

def initialize
  super()
  @tag = "input"
end

Instance Method Details

#nameObject



54
55
56
# File 'lib/object_view/input.rb', line 54

def name
  self.attributes['name']
end

#name=(text) ⇒ Object



50
51
52
# File 'lib/object_view/input.rb', line 50

def name= text
  self.attr('name', text)
end

#read_onlyObject



58
59
60
# File 'lib/object_view/input.rb', line 58

def read_only
  self.attr('readonly')
end

#read_only=(value) ⇒ Object



62
63
64
# File 'lib/object_view/input.rb', line 62

def read_only= value
  self.attr('readonly', value)
end

#typeObject



46
47
48
# File 'lib/object_view/input.rb', line 46

def type
  return self.attr('type')
end

#type=(text) ⇒ Object



42
43
44
# File 'lib/object_view/input.rb', line 42

def type= text
  self.attr('type', text)
end

#valueObject



38
39
40
# File 'lib/object_view/input.rb', line 38

def value
  return self.attr('value')
end

#value=(text) ⇒ Object



34
35
36
# File 'lib/object_view/input.rb', line 34

def value= text
  self.attr('value', text)
end