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-16.1.5 lib/lhs/concerns/record/mapping.rb
lhs-16.1.4 lib/lhs/concerns/record/mapping.rb
lhs-16.1.3 lib/lhs/concerns/record/mapping.rb
lhs-16.1.2 lib/lhs/concerns/record/mapping.rb
lhs-16.1.1 lib/lhs/concerns/record/mapping.rb
lhs-16.1.0 lib/lhs/concerns/record/mapping.rb
lhs-16.0.1 lib/lhs/concerns/record/mapping.rb
lhs-16.0.0 lib/lhs/concerns/record/mapping.rb
lhs-15.7.0 lib/lhs/concerns/record/mapping.rb
lhs-15.6.1 lib/lhs/concerns/record/mapping.rb
lhs-15.6.0 lib/lhs/concerns/record/mapping.rb
lhs-15.5.1 lib/lhs/concerns/record/mapping.rb
lhs-15.5.0 lib/lhs/concerns/record/mapping.rb
lhs-15.4.1 lib/lhs/concerns/record/mapping.rb
lhs-15.4.0 lib/lhs/concerns/record/mapping.rb
lhs-15.4.0.pre.hasone.1 lib/lhs/concerns/record/mapping.rb
lhs-15.3.3 lib/lhs/concerns/record/mapping.rb
lhs-15.3.3.pre.fixoptions.1 lib/lhs/concerns/record/mapping.rb
lhs-15.3.2 lib/lhs/concerns/record/mapping.rb
lhs-15.3.1 lib/lhs/concerns/record/mapping.rb