Added 'to_h' and 'to_json' methods
Added 'to_h' and 'to_json' methods

- Added 'to_json' method for easier export to clientside javascript
  primarily (e.g. getting the enum as an object in a '.js.erb" file).
  Options ':only' and ':except' can be passed with either a symbol or
  an array of symbols. The possible symbols are the fields for the
  'Entry' struct class, 'const_name', 'key', 'value', and 'label'.

  Example:
  User::Role.to_json(only: :value) => "{\"ADMIN\":0,\"EDITOR\":1,\"AUTHOR\":2,\"USER\":3}"

- Added 'to_h' method to create a hash representation of the enum
  with the same options ':only' and ':except' as the 'to_json' method.
  In fact, the 'to_json' method uses the 'to_h' method to get the hash
  and then converts that hash to a json string via 'Hash#to_json'.

jfairbank/rails_attr_enum,jfairbank/rails_attr_enum