Skip to content

Instantly share code, notes, and snippets.

@batasrki
Forked from myronmarston/engine_variant.rb
Created May 30, 2011 20:04
Show Gist options
  • Save batasrki/999394 to your computer and use it in GitHub Desktop.
Save batasrki/999394 to your computer and use it in GitHub Desktop.
class EngineVariant
def api_representation
{ engine: engine, locale: locale }
end
end
class Subscription
def api_representation
{
name: name,
schedule: schedule.try(:api_representation),
queries: queries.to_a,
engine_variants: engine_variants.map(&:api_representation),
url_fragments: url_fragments.map(&:api_representation)
}
end
end
class SubscriptionSchedule
def api_representation
{
interval: interval,
start_date: start_date
}
end
end
class URLFragment
def api_representation
{
type: type,
value: value,
name: name
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment