Skip to content

Instantly share code, notes, and snippets.

@garethrees
Last active March 22, 2016 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garethrees/7a1d70931cb5e8031fe4 to your computer and use it in GitHub Desktop.
Save garethrees/7a1d70931cb5e8031fe4 to your computer and use it in GitHub Desktop.
Value Object Dictionary

I have a view helper: track_analytics_event(event_category, event_action).

Currently you might do something like this:

<%= track_analytics_event('Facebook Page Exit', 'Shared Transaction')

I want to create some sort of dictionary to avoid a complete mess of duplicated values (e.g. someone may use 'Facebook exit' when they mean 'Facebook Page Exit')

How would you go about this?

Additions to the default dictionary must be allowed; this will be a library that an end user might want to add to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment