Class: Fat::Color
Constant Summary
Constants inherited
from Fit::Fixture
Fit::Fixture::GRAY, Fit::Fixture::GREEN, Fit::Fixture::RED, Fit::Fixture::YELLOW
Instance Attribute Summary
Attributes inherited from Fit::Fixture
#args, #counts, #listener, #summary
Instance Method Summary
collapse
#check, #check_boolean, #check_value, #parse_boolean, #parse_double, #parse_integer
camel, #check, #do_cells, #do_table, #do_tables, #error, escape, #exception, #find_class, #fixture_name, #get_args_for_table, #get_linked_fixture_with_args, gray, #ignore, #info, #initialize, #interpret_following_tables, #interpret_tables, label, metadata, #parse, #right, #total_errors, #totals, #wrong
Constructor Details
This class inherits a constructor from Fit::Fixture
Instance Method Details
#color(cell) ⇒ Object
22
23
24
25
26
|
# File 'lib/fat/color.rb', line 22
def color cell
b = cell.tag, 'bgcolor="', 'white'
f = cell.body, '<font color="', 'black'
f == 'black' ? b : "#{f}/#{b}"
end
|
#do_cell(cell, column_index) ⇒ Object
19
20
21
|
# File 'lib/fat/color.rb', line 19
def do_cell cell, column_index
check_value cell, color(@actual_row.parts.at(column_index))
end
|
#do_row(row) ⇒ Object
15
16
17
18
|
# File 'lib/fat/color.rb', line 15
def do_row row
super
@actual_row = @actual_row.more
end
|
#do_rows(rows) ⇒ Object
10
11
12
13
14
|
# File 'lib/fat/color.rb', line 10
def do_rows rows
@actual_row = Table.table.parts
raise "wrong size table" if not rows.size == @actual_row.size
super
end
|
27
28
29
30
31
32
|
# File 'lib/fat/color.rb', line 27
def text, pattern, default_color
index = text.index pattern
return default_color if index.nil?
index += pattern.size
decode text[index..(index + 6)]
end
|