Module: Roar::Representer::JSON::CollectionJSON::ClassMethods::SharedClassMethodsBullshit

Included in:
Roar::Representer::JSON::CollectionJSON::ClassMethods
Defined in:
lib/roar/representer/json/collection_json.rb

Instance Method Summary collapse

Instance Method Details

#href(&block) ⇒ Object



138
139
140
141
142
143
144
145
146
# File 'lib/roar/representer/json/collection_json.rb', line 138

def href(&block)
  mod = representable_attrs.collection_representers[:href] = Module.new do
    include Roar::Representer::JSON
    include Roar::Representer::Feature::Hypermedia


    link(:href, &block)
  end
end

#representable_attrsObject



148
149
150
151
152
153
154
155
156
# File 'lib/roar/representer/json/collection_json.rb', line 148

def representable_attrs
  super.tap do |attrs|
    attrs.instance_eval do # FIXME: of course, this is WIP.
      def collection_representers
        @collection_representers ||= {}
      end
    end
  end
end