Skip to content

Instantly share code, notes, and snippets.

@Haar
Last active August 29, 2015 14:01
Show Gist options
  • Save Haar/081dfa1759d631032a19 to your computer and use it in GitHub Desktop.
Save Haar/081dfa1759d631032a19 to your computer and use it in GitHub Desktop.
AuditZoneArraySerializer = Struct.new(:audit_zone_array, :current) do
def to_json
self.audit_zone_array.inject([]) do |array, zone|
highlight = (zone == self.current)
ary << {
name: zone.description.titlecase,
y: zone.community_percentage,
sliced: highlight,
selected: highlight,
color: zone.color
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment