class Zoho::People::Attendance

Attributes

check_in[R]
check_out[R]
email[R]

Public Class Methods

new(email:, check_in:, check_out:) click to toggle source
# File lib/zoho/people/attendance.rb, line 8
def initialize(email:, check_in:, check_out:)
  raise ArgumentError, 'check_in must be DateTime instance' unless check_in.is_a?(DateTime)
  raise ArgumentError, 'check_out must be DateTime instance' unless check_out.is_a?(DateTime)

  @email = email
  @check_in = check_in
  @check_out = check_out
end

Public Instance Methods

to_s() click to toggle source
# File lib/zoho/people/attendance.rb, line 17
def to_s
  "attendance from #{format(check_in)} to #{format(check_out)}"
end

Private Instance Methods

format(datetime) click to toggle source
# File lib/zoho/people/attendance.rb, line 23
def format(datetime)
  datetime.strftime('%F@%H:%M')
end