Class: SK::Cell
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
row is an element that “remembers” it’s index in the row.
Attributes inherited from Element
Instance Method Summary collapse
- #as_num ⇒ Object
-
#initialize(locator, index) ⇒ Cell
constructor
A new instance of Cell.
- #to_s ⇒ Object
Methods inherited from Element
#children, #displayed?, #enabled?, #exists?, #find, #find_child_el, #html, #parent_el, #search, #text
Constructor Details
#initialize(locator, index) ⇒ Cell
Returns a new instance of Cell.
7 8 9 10 |
# File 'lib/table.rb', line 7 def initialize(locator,index) super(locator) # creates the el and locator @index = index # remember your position end |
Instance Attribute Details
#index ⇒ Object (readonly)
row is an element that “remembers” it’s index in the row
5 6 7 |
# File 'lib/table.rb', line 5 def index @index end |
Instance Method Details
#as_num ⇒ Object
12 13 14 15 16 |
# File 'lib/table.rb', line 12 def as_num # trace "cell = #{cell.text}" sign = self.text.include?('(') ? -1 : 1 sign * self.text.gsub(/[$,()]/, '').to_f end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/table.rb', line 18 def to_s "<SK::Cell #{@index} [#{self.text}]>" end |