Class: Zoho::People::Attendance
- Inherits:
-
Object
- Object
- Zoho::People::Attendance
- Defined in:
- lib/zoho/people/attendance.rb
Instance Attribute Summary collapse
-
#check_in ⇒ Object
readonly
Returns the value of attribute check_in.
-
#check_out ⇒ Object
readonly
Returns the value of attribute check_out.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
-
#initialize(email:, check_in:, check_out:) ⇒ Attendance
constructor
A new instance of Attendance.
- #to_s ⇒ Object
Constructor Details
#initialize(email:, check_in:, check_out:) ⇒ Attendance
Returns a new instance of Attendance.
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_in ⇒ Object (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_out ⇒ Object (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 |
#email ⇒ Object (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_s ⇒ Object
17 18 19 |
# File 'lib/zoho/people/attendance.rb', line 17 def to_s "attendance from #{format(check_in)} to #{format(check_out)}" end |