Class: Eg::ArithmeticColumnFixture
- Inherits:
-
Fit::ColumnFixture
- Object
- Fit::Fixture
- Fit::ColumnFixture
- Eg::ArithmeticColumnFixture
- Defined in:
- lib/eg/arithmetic_column_fixture.rb
Constant Summary collapse
- @@metadata =
{ 'sin()' => Fit::ScientificDouble, 'cos()' => Fit::ScientificDouble }
Constants inherited from Fit::Fixture
Fit::Fixture::GRAY, Fit::Fixture::GREEN, Fit::Fixture::RED, Fit::Fixture::YELLOW
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Attributes inherited from Fit::Fixture
#args, #counts, #listener, #summary
Instance Method Summary collapse
- #cos ⇒ Object
- #divide ⇒ Object
- #floating ⇒ Object
- #minus ⇒ Object
- #plus ⇒ Object
- #sin ⇒ Object
- #times ⇒ Object
Methods inherited from Fit::ColumnFixture
#check, #do_cell, #do_row, #do_rows, #execute, #reset
Methods inherited from Fit::Fixture
camel, #check, #do_cell, #do_cells, #do_row, #do_rows, #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 Attribute Details
#x ⇒ Object
Returns the value of attribute x.
10 11 12 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 10 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
10 11 12 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 10 def y @y end |
Instance Method Details
#cos ⇒ Object
30 31 32 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 30 def cos Fit::ScientificDouble.new Math.cos(x / 180.0 * Math::PI) end |
#divide ⇒ Object
21 22 23 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 21 def divide x / y end |
#floating ⇒ Object
24 25 26 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 24 def floating Float(x) / Float(y) end |
#minus ⇒ Object
15 16 17 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 15 def minus x - y end |
#plus ⇒ Object
12 13 14 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 12 def plus x + y end |
#sin ⇒ Object
27 28 29 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 27 def sin Fit::ScientificDouble.new Math.sin(x / 180.0 * Math::PI) end |
#times ⇒ Object
18 19 20 |
# File 'lib/eg/arithmetic_column_fixture.rb', line 18 def times x * y end |