Class: Aurita::GUI::Table_Cell
- Defined in:
- lib/aurita-gui/table.rb
Overview
Accessor for a table cell. Usage:
cell = my_table[row][column]
cell.content = 'New cell content'
cell.class = 'table_cell_css_class'
Instance Attribute Summary collapse
-
#presentation_class ⇒ Object
Returns the value of attribute presentation_class.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Element
#attrib, #force_closing_tag, #parent, #tag
Instance Method Summary collapse
-
#initialize(cell_element, params = {}) ⇒ Table_Cell
constructor
A new instance of Table_Cell.
- #set_presentation(presentation_class) ⇒ Object
- #string ⇒ Object
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=
Methods included from Marshal_Helper_Class_Methods
Methods included from Marshal_Helper
Constructor Details
#initialize(cell_element, params = {}) ⇒ Table_Cell
Returns a new instance of Table_Cell.
157 158 159 160 161 162 163 |
# File 'lib/aurita-gui/table.rb', line 157 def initialize(cell_element, params={}) params[:tag] = 'td' @presentation_class = false super(params) @value = cell_element @content = cell_element end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Aurita::GUI::Element
Instance Attribute Details
#presentation_class ⇒ Object
Returns the value of attribute presentation_class.
155 156 157 |
# File 'lib/aurita-gui/table.rb', line 155 def presentation_class @presentation_class end |
#value ⇒ Object
Returns the value of attribute value.
155 156 157 |
# File 'lib/aurita-gui/table.rb', line 155 def value @value end |
Instance Method Details
#set_presentation(presentation_class) ⇒ Object
175 176 177 |
# File 'lib/aurita-gui/table.rb', line 175 def set_presentation(presentation_class) @presentation_class = presentation_class end |
#string ⇒ Object
179 180 181 182 183 184 185 186 |
# File 'lib/aurita-gui/table.rb', line 179 def string if @presentation_class then @content = @presentation_class.new(@value).string else @content = @value.to_s end super() end |