Skip to content

Instantly share code, notes, and snippets.

@apotonick
Created June 11, 2015 23:02
Show Gist options
  • Save apotonick/2a507ceccc36ec1875af to your computer and use it in GitHub Desktop.
Save apotonick/2a507ceccc36ec1875af to your computer and use it in GitHub Desktop.
Infer representer from contract (Reform 2)
contract_class = ...
representer_class = Disposable::Twin::Schema.from(contract_class,
include: [Roar::JSON],
superclass: Representable::Decorator,
representer_from: lambda { |inline| inline.representer_class },
options_from: :deserializer
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment