Class: Domain::Pto
- Inherits:
-
Object
- Object
- Domain::Pto
- Defined in:
- lib/bas/domain/pto.rb
Overview
The Domain::Pto class provides a domain-specific representation of a Paid Time Off (PTO) object. It encapsulates information about an individual’s time off, including the individual’s name, the start date, and the end date of the time off period.
Constant Summary collapse
- ATTRIBUTES =
%w[individual_name start_date end_date].freeze
Instance Attribute Summary collapse
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#individual_name ⇒ Object
readonly
Returns the value of attribute individual_name.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#initialize(individual_name, start_date, end_date) ⇒ Pto
constructor
Initializes a Domain::Pto instance with the specified individual name, start date, and end date.
Constructor Details
#initialize(individual_name, start_date, end_date) ⇒ Pto
Initializes a Domain::Pto instance with the specified individual name, start date, and end date.
Params:
-
String
individual_name Name of the individual. -
DateTime
start_date Start day of the PTO. -
String
end_date End date of the PTO.
22 23 24 25 26 |
# File 'lib/bas/domain/pto.rb', line 22 def initialize(individual_name, start_date, end_date) @individual_name = individual_name @start_date = start_date @end_date = end_date end |
Instance Attribute Details
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
10 11 12 |
# File 'lib/bas/domain/pto.rb', line 10 def end_date @end_date end |
#individual_name ⇒ Object (readonly)
Returns the value of attribute individual_name.
10 11 12 |
# File 'lib/bas/domain/pto.rb', line 10 def individual_name @individual_name end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
10 11 12 |
# File 'lib/bas/domain/pto.rb', line 10 def start_date @start_date end |