Class: Zoho::People::Attendance

Inherits:
Object
  • Object
show all
Defined in:
lib/zoho/people/attendance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email:, check_in:, check_out:) ⇒ Attendance

Returns a new instance of Attendance.

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
15
# 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

Instance Attribute Details

#check_inObject (readonly)

Returns the value of attribute check_in.



6
7
8
# File 'lib/zoho/people/attendance.rb', line 6

def check_in
  @check_in
end

#check_outObject (readonly)

Returns the value of attribute check_out.



6
7
8
# File 'lib/zoho/people/attendance.rb', line 6

def check_out
  @check_out
end

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/zoho/people/attendance.rb', line 6

def email
  @email
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/zoho/people/attendance.rb', line 17

def to_s
  "attendance from #{format(check_in)} to #{format(check_out)}"
end