Sha256: 07e51285a6749f58924063fe214e87a8fc85eb0e4635be3e05c8169cf1982ef6

Contents?: true

Size: 395 Bytes

Versions: 20

Compression:

Stored size: 395 Bytes

Contents

require 'active_support'

class LHS::Service

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

    attr_accessor :mapping

    module ClassMethods

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

    def initialize
      self.mapping = {}
      super
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
lhs-1.6.1 lib/lhs/concerns/service/mapping.rb
lhs-1.6.0 lib/lhs/concerns/service/mapping.rb
lhs-2.0.5 lib/lhs/concerns/service/mapping.rb
lhs-2.0.4 lib/lhs/concerns/service/mapping.rb
lhs-2.0.3 lib/lhs/concerns/service/mapping.rb
lhs-2.0.2 lib/lhs/concerns/service/mapping.rb
lhs-2.0.1 lib/lhs/concerns/service/mapping.rb
lhs-2.0.0 lib/lhs/concerns/service/mapping.rb
lhs-1.5.0 lib/lhs/concerns/service/mapping.rb
lhs-1.4.0 lib/lhs/concerns/service/mapping.rb
lhs-1.3.1 lib/lhs/concerns/service/mapping.rb
lhs-1.3.0 lib/lhs/concerns/service/mapping.rb
lhs-1.2.3 lib/lhs/concerns/service/mapping.rb
lhs-1.2.2 lib/lhs/concerns/service/mapping.rb
lhs-1.2.1 lib/lhs/concerns/service/mapping.rb
lhs-1.2.0 lib/lhs/concerns/service/mapping.rb
lhs-1.1.0 lib/lhs/concerns/service/mapping.rb
lhs-1.0.0 lib/lhs/concerns/service/mapping.rb
lhs-0.4.0 lib/lhs/concerns/service/mapping.rb
lhs-0.3.0 lib/lhs/concerns/service/mapping.rb