Class: Aurita::GUI::Table_Row
Instance Attribute Summary
Attributes inherited from Element
#attrib, #force_closing_tag, #parent, #tag
Instance Method Summary
collapse
Methods inherited from Element
#+, #<<, #add_class, #clear_floating, #css_classes, #find_by_dom_id, #get_content, #has_content?, #id, #id=, #method_missing, #recurse, #remove_class, #set_content, #swap, #to_ary, #type=
#marshal_load
#marshal_dump
Constructor Details
#initialize(cell_data, params = {}) ⇒ Table_Row
Returns a new instance of Table_Row.
101
102
103
104
105
106
107
108
109
|
# File 'lib/aurita-gui/table.rb', line 101
def initialize(cell_data, params={})
@cell_data = cell_data
@cells = []
@cell_data.each { |cell|
@cells << Table_Cell.new(cell, :parent => self)
}
params[:tag] = 'tr'
super(params)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Aurita::GUI::Element
Instance Method Details
#[](column_index) ⇒ Object
115
116
117
|
# File 'lib/aurita-gui/table.rb', line 115
def [](column_index)
@cells[column_index]
end
|
#[]=(column_index, cell_data) ⇒ Object
118
119
120
|
# File 'lib/aurita-gui/table.rb', line 118
def []=(column_index, cell_data)
@cells[column_index].value = cell_data
end
|
#inspect ⇒ Object
127
128
129
|
# File 'lib/aurita-gui/table.rb', line 127
def inspect
'[' << @cells.collect { |c| c.value }.join(',') + ']'
end
|
#string ⇒ Object
122
123
124
125
|
# File 'lib/aurita-gui/table.rb', line 122
def string
@content = "\n" << @cells.collect { |c| c.string }.join()
super()
end
|
#table ⇒ Object
111
112
113
|
# File 'lib/aurita-gui/table.rb', line 111
def table
@params[:parent]
end
|