Class: KingOfTime

Inherits:
Object
  • Object
show all
Defined in:
lib/king_of_time.rb,
lib/king_of_time/version.rb

Overview

Main class

Constant Summary collapse

END_POINT =
'https://kingoftime-recorder.appspot.com/ajax?function=record_timestamp_and_log'.freeze
VERSION =
'0.2.0'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(name:, employee_id:, timerecorder_id:, password:) ⇒ KingOfTime

Returns a new instance of KingOfTime.



9
10
11
12
13
14
15
# File 'lib/king_of_time.rb', line 9

def initialize(name:, employee_id:, timerecorder_id:, password:)
  @param = {}
  @param[:name] = name
  @param[:employee_id] = employee_id
  @param[:timerecorder_id] = @param[:employee_timerecorder_id] = timerecorder_id
  @param[:password] = password
end

Instance Method Details

#check_inObject



17
18
19
# File 'lib/king_of_time.rb', line 17

def check_in
  http_request(:checkin)
end

#check_outObject



21
22
23
# File 'lib/king_of_time.rb', line 21

def check_out
  http_request(:checkout)
end

#end_breakObject



30
31
32
# File 'lib/king_of_time.rb', line 30

def end_break
  http_request(:end_break)
end

#start_breakObject



26
27
28
# File 'lib/king_of_time.rb', line 26

def start_break
  http_request(:start_break)
end