Created
February 10, 2016 16:05
-
-
Save adamphillips/853482a9d5d3bb68da1c 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 FairSummaryJson | |
def initialize(fair, options={}) | |
@cash_report_url = options.fetch(:cash_report_url) { '' } | |
end | |
def to_hash | |
{ | |
id: fair.id, | |
school: SchoolSummaryJson.new(fair.school).to_hash | |
cash_report_url: cash_report_url | |
} | |
end | |
end | |
def FairDetailJson | |
... | |
end | |
def SchoolSummaryJson | |
def initialize(school) | |
@school = school | |
end | |
def to_hash | |
{ | |
id: school.id | |
name: school.name | |
} | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment