Class: Menu::TimeMenu::IntervaltimeMenu

Inherits:
TimeMenu show all
Defined in:
lib/menu/worktime/intervaltime_menu.rb

Overview

menu class to serve as a parent class for interval based time menus

Direct Known Subclasses

MonthtimeMenu, WeektimeMenu

Instance Attribute Summary

Attributes inherited from TimeMenu

#additions, #time_string, #values

Attributes inherited from Base

#menu_description, #menu_items

Instance Method Summary collapse

Methods inherited from TimeMenu

#calculate_worktime, #check_attributes, #check_time_string, #define_menu_items, #determine_action, #initialize, #output_to_csv, #print_all_tasks, #print_tasks_in_interval, #print_tasks_to_key, #retrieve_and_print_worktime, #retrieve_tasks, #retrieve_worktime, #set_boundaries

Methods inherited from Base

#add_menu_item, #define_menu_items, #determine_action, #get_entry, #handle_wrong_option, #initialize, #print_menu

Constructor Details

This class inherits a constructor from Menu::TimeMenu::TimeMenu

Instance Method Details

#get_input_valuesObject (private)

method to retrieve the required input values



13
14
15
16
17
18
19
# File 'lib/menu/worktime/intervaltime_menu.rb', line 13

def get_input_values
  @values = Hash.new()
  @values[:id] = get_entry("Worktime for which ID? ").to_i
  @values[:year] = get_entry("Specify year: ").to_i
  @values[:time_frame] =
          get_entry("Specify #{@time_string} of year: ").to_i
end

#set_values(times) ⇒ Object (private)

method to set the values for start and end time



22
23
24
25
# File 'lib/menu/worktime/intervaltime_menu.rb', line 22

def set_values(times)
  @values[:start_time] = times[:actual]
  @values[:end_time] = times[:next]
end