Sha256: 6720c8661685d98496ce413e0db2db966796b3f2111a2e298e3fd7942082f27b

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

# encoding: UTF-8

module Materializer # :nodoc:
  module CoreExt # :nodoc: 
    module Array
      extend ActiveSupport::Concern

      module InstanceMethods

        # Return content from a materialized profile.
        #
        def from_materialized(options)
          map do |o|

            # Unfortunately, need to unescape to properly combine it.
            #
            # This is still extremely faster, by an order of 5% or
            # percent faster.
            #
            ActiveSupport::JSON.decode(o.from_materialized(options))

          end
        end

      end
    end
  end
end

Array.send :include, Materializer::CoreExt::Array

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
materializer-0.0.1 lib/materializer/core_ext.rb