Sha256: d274685b8f139277539974de1f28945812cb7c414923af25e868d39a4ef0a06f

Contents?: true

Size: 411 Bytes

Versions: 165

Compression:

Stored size: 411 Bytes

Contents

require 'active_support'

class LHS::Record

  # Mapping allows to configure some accessors that access data using a provided proc
  module Mapping
    extend ActiveSupport::Concern

    module ClassMethods
      def mapping
        @mapping ||= {}
      end

      def mapping=(mapping)
        @mapping = mapping
      end

      def map(name, block)
        mapping[name] = block
      end
    end
  end
end

Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
lhs-7.2.1 lib/lhs/concerns/record/mapping.rb
lhs-7.2.0 lib/lhs/concerns/record/mapping.rb
lhs-7.1.0 lib/lhs/concerns/record/mapping.rb
lhs-7.0.3 lib/lhs/concerns/record/mapping.rb
lhs-7.0.2 lib/lhs/concerns/record/mapping.rb
lhs-7.0.1 lib/lhs/concerns/record/mapping.rb
lhs-7.0.0 lib/lhs/concerns/record/mapping.rb
lhs-6.8.2 lib/lhs/concerns/record/mapping.rb
lhs-6.8.1 lib/lhs/concerns/record/mapping.rb
lhs-6.8.0 lib/lhs/concerns/record/mapping.rb
lhs-6.7.2 lib/lhs/concerns/record/mapping.rb
lhs-6.7.1 lib/lhs/concerns/record/mapping.rb
lhs-6.7.0 lib/lhs/concerns/record/mapping.rb
lhs-6.6.2 lib/lhs/concerns/record/mapping.rb
lhs-6.6.1 lib/lhs/concerns/record/mapping.rb
lhs-6.6.0 lib/lhs/concerns/record/mapping.rb
lhs-6.5.0 lib/lhs/concerns/record/mapping.rb
lhs-6.4.0 lib/lhs/concerns/record/mapping.rb
lhs-6.3.1 lib/lhs/concerns/record/mapping.rb
lhs-6.3.0 lib/lhs/concerns/record/mapping.rb