module Encore module Entity module Output module JSON # Return each exposed attribute as a JSON value def as_json(args = {}) self.class.exposed_attributes.inject({}) do |memo, item| memo.merge item.attribute => item.fetch(self) end end end end end end