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-11.0.1 lib/lhs/concerns/record/mapping.rb
lhs-11.0.0 lib/lhs/concerns/record/mapping.rb
lhs-10.1.1 lib/lhs/concerns/record/mapping.rb
lhs-10.1.0 lib/lhs/concerns/record/mapping.rb
lhs-10.0.0 lib/lhs/concerns/record/mapping.rb
lhs-9.1.1 lib/lhs/concerns/record/mapping.rb
lhs-9.1.0 lib/lhs/concerns/record/mapping.rb
lhs-9.0.4 lib/lhs/concerns/record/mapping.rb
lhs-9.0.3 lib/lhs/concerns/record/mapping.rb
lhs-9.0.2 lib/lhs/concerns/record/mapping.rb
lhs-9.0.1 lib/lhs/concerns/record/mapping.rb
lhs-9.0.0 lib/lhs/concerns/record/mapping.rb
lhs-8.0.0 lib/lhs/concerns/record/mapping.rb
lhs-7.4.1 lib/lhs/concerns/record/mapping.rb
lhs-7.4.0 lib/lhs/concerns/record/mapping.rb
lhs-7.3.0 lib/lhs/concerns/record/mapping.rb
lhs-7.2.5 lib/lhs/concerns/record/mapping.rb
lhs-7.2.4 lib/lhs/concerns/record/mapping.rb
lhs-7.2.3 lib/lhs/concerns/record/mapping.rb
lhs-7.2.2 lib/lhs/concerns/record/mapping.rb