Class: Eg::Book::Rent::CalculateLateHours

Inherits:
Fit::ColumnFixture show all
Defined in:
lib/eg/book/rent/calculate_late_hours.rb

Constant Summary

Constants inherited from Fit::Fixture

Fit::Fixture::GRAY, Fit::Fixture::GREEN, Fit::Fixture::RED, Fit::Fixture::YELLOW

Instance Attribute Summary collapse

Attributes inherited from Fit::Fixture

#args, #counts, #listener, #summary

Instance Method Summary collapse

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

#count_grace=(string) ⇒ Object (writeonly)

Sets the attribute count_grace

Parameters:

  • value

    the value to set the attribute count_grace to.



9
10
11
# File 'lib/eg/book/rent/calculate_late_hours.rb', line 9

def count_grace=(value)
  @count_grace = value
end

#grace=(value) ⇒ Object (writeonly)

Sets the attribute grace

Parameters:

  • value

    the value to set the attribute grace to.



8
9
10
# File 'lib/eg/book/rent/calculate_late_hours.rb', line 8

def grace=(value)
  @grace = value
end

#high_demand=(value) ⇒ Object (writeonly)

Sets the attribute high_demand

Parameters:

  • value

    the value to set the attribute high_demand to.



8
9
10
# File 'lib/eg/book/rent/calculate_late_hours.rb', line 8

def high_demand=(value)
  @high_demand = value
end

#hours_late=(value) ⇒ Object (writeonly)

Sets the attribute hours_late

Parameters:

  • value

    the value to set the attribute hours_late to.



8
9
10
# File 'lib/eg/book/rent/calculate_late_hours.rb', line 8

def hours_late=(value)
  @hours_late = value
end

Instance Method Details

#extra_hoursObject



13
14
15
16
# File 'lib/eg/book/rent/calculate_late_hours.rb', line 13

def extra_hours
  late_returns = LateReturns.new @count_grace
  late_returns.extra_hours @hours_late, @grace, @high_demand
end