Sha256: f186f652dbcd38186441fc16e4324bbe818a587bd0746be791cc85cc1962d038

Contents?: true

Size: 477 Bytes

Versions: 11

Compression:

Stored size: 477 Bytes

Contents

module Representable
  # Using this module only makes sense with Decorator representers.
  module Cached
    module BuildDefinition
      def build_definition(*)
        super.tap do |definition|
          binding_builder = format_engine::Binding

          map << binding_builder.build(definition)
        end
      end
    end

    def self.included(includer)
      includer.extend(BuildDefinition)
    end

    def representable_map(*)
      self.class.map
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
representable-3.0.4 lib/representable/cached.rb
representable-3.0.3 lib/representable/cached.rb
representable-3.0.2 lib/representable/cached.rb
representable-3.0.1 lib/representable/cached.rb
representable-3.0.0 lib/representable/cached.rb
representable-2.4.1 lib/representable/cached.rb
representable-2.4.0 lib/representable/cached.rb
representable-2.4.0.rc5 lib/representable/cached.rb
representable-2.4.0.rc4 lib/representable/cached.rb
representable-2.4.0.rc3 lib/representable/cached.rb
representable-2.4.0.rc2 lib/representable/cached.rb