class Para::ModelFieldParsers::Base

Attributes

fields_hash[R]
mappings[R]
model[R]

Public Class Methods

new(model, fields_hash, mappings) click to toggle source
# File lib/para/model_field_parsers/base.rb, line 10
def initialize(model, fields_hash, mappings)
  @model = model
  @fields_hash = fields_hash
  @mappings = mappings
end
register(key, parser) click to toggle source
# File lib/para/model_field_parsers/base.rb, line 4
def self.register(key, parser)
  ModelFieldParsers.registered_parsers[key] = parser
end

Public Instance Methods

applicable?() click to toggle source
# File lib/para/model_field_parsers/base.rb, line 16
def applicable?
  true
end
find_attributes_for_mapping(type) click to toggle source
# File lib/para/model_field_parsers/base.rb, line 20
def find_attributes_for_mapping(type)
  mappings.select { |k, v| v == type.to_s }.keys.map(&:to_sym)
end