roundtrip + some refactor

I've done some refactor, getting rid of some of the lambdas (still some left, a method that returns 3 things, etc)
Also now to_media_type returns ... A media type! surprise! 
The previous to_media_type returned a hash which is no really any other thing in the system so I have named it to_representing_hash. Because it is also not a RepresnetorHash class.
Not a great name but the proposed  'as_media_type' does not cut it for me either as it returns a hash, not anything similar to a media type. 

Ideally, this is consistent, conceptually across all potential media-types
as the internal implementation method, so it works for xml based media type
as well. That is why I liked #as_media_type myself. Follows ActiveModel
Serialization interface as well. Regardless, if this is going to be a
private internal abstract method, it could be #serialized_object or
something.


On Wed, Jul 9, 2014 at 10:57 PM, cabbott <notifications@github.com> wrote:

> In lib/representors/serialization/hal_serializer.rb:
>
> > @@ -10,29 +10,44 @@ class HalSerializer < SerializerBase
> >        media_symbol :hal
> >        media_type 'application/hal+json'
> >
> > +      # This is public and returning a hash to be able to implement embedded resources
> > +      # serialization
> > +      # TODO: make this private and merge with to_media_type
> > +      # The name is quite misleading,
> > +      def to_representing_hash(options = {})
>
> How about to_hash?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mdsol/crichton-representors/pull/29/files#r14750628>.
>