Created
February 22, 2012 14:32
-
-
Save mraaroncruz/1885356 to your computer and use it in GitHub Desktop.
TimespanForWorkRelationship
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TimespanForWorkRelationship | |
def initialize(worker, business) | |
# retrieves all work assignments for relationship | |
work_assignments = WorkAssignment.for(worker, business) | |
@months = create_related_months_for(work_assignments) | |
end | |
def create_related_months_for(work_assignments) | |
# logic to pull months out of workspans | |
end | |
def includes?(year, month) | |
@months.any? { |month| | |
month.year == year && month.month == month | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment