Created
November 3, 2012 14:11
-
-
Save jnwheeler44/4007479 to your computer and use it in GitHub Desktop.
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 Report | |
def date_reported_formatted(format='%m/%d/%Y ') | |
date_reported.strftime(format) | |
end | |
end | |
class NullReport | |
def method_missing(meth, *args) | |
"No Report" | |
end | |
end |
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 Result | |
def active_report | |
active_reports.first || NullReport.new | |
end | |
def get_date_of_report | |
active_report.date_reported_formatted | |
end | |
def get_datetime_result_date_of_report | |
active_report.date_reported | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment