Sha256: 938a159839edbc02fcacf29dc433fa64e483fd9a27462b981be0a06eed7dbecf

Contents?: true

Size: 548 Bytes

Versions: 49

Compression:

Stored size: 548 Bytes

Contents

module Para
  module ModelFieldParsers
    class Base
      def self.register(key, parser)
        ModelFieldParsers.registered_parsers[key] = parser
      end

      attr_reader :model, :fields_hash, :mappings

      def initialize(model, fields_hash, mappings)
        @model = model
        @fields_hash = fields_hash
        @mappings = mappings
      end

      def applicable?
        true
      end

      def find_attributes_for_mapping(type)
        mappings.select { |k, v| v == type.to_s }.keys.map(&:to_sym)
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
para-0.12.4 lib/para/model_field_parsers/base.rb
para-0.12.3 lib/para/model_field_parsers/base.rb
para-0.12.2 lib/para/model_field_parsers/base.rb
para-0.12.1 lib/para/model_field_parsers/base.rb
para-0.12.0 lib/para/model_field_parsers/base.rb
para-0.11.4 lib/para/model_field_parsers/base.rb
para-0.11.3 lib/para/model_field_parsers/base.rb
para-0.11.2 lib/para/model_field_parsers/base.rb
para-0.11.1 lib/para/model_field_parsers/base.rb
para-0.11.0 lib/para/model_field_parsers/base.rb
para-0.10.0 lib/para/model_field_parsers/base.rb
para-0.9.4 lib/para/model_field_parsers/base.rb
para-0.9.3.3 lib/para/model_field_parsers/base.rb
para-0.9.3.2 lib/para/model_field_parsers/base.rb
para-0.9.3.1 lib/para/model_field_parsers/base.rb
para-0.9.2 lib/para/model_field_parsers/base.rb
para-0.9.0 lib/para/model_field_parsers/base.rb
para-0.8.15 lib/para/model_field_parsers/base.rb
para-0.8.14 lib/para/model_field_parsers/base.rb
para-0.8.13 lib/para/model_field_parsers/base.rb