Sha256: 94ebe207dbca3468aac5b488dafed6a60f65196fc98b8a9e038654a8796ad8e1

Contents?: true

Size: 648 Bytes

Versions: 5

Compression:

Stored size: 648 Bytes

Contents

module Chicago
  module ETL
    module Screens
      class InvalidElement < ColumnScreen
        def self.for_columns(table_name, columns)
          screens = columns.select(&:elements).
            map {|column| new(table_name, column) }
          CompositeScreen.new(screens)
        end

        def severity
          3
        end

        def applies?(value)
          column.elements && 
            !column.elements.map(&:downcase).include?(value.to_s.downcase)
        end

        def error_hash(value)
          super(value).
            merge(:error_detail => "'#{value}' is not a valid value.")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chicago-etl-0.0.13 lib/chicago/etl/screens/invalid_element.rb
chicago-etl-0.0.12 lib/chicago/etl/screens/invalid_element.rb
chicago-etl-0.0.11 lib/chicago/etl/screens/invalid_element.rb
chicago-etl-0.0.10 lib/chicago/etl/screens/invalid_element.rb
chicago-etl-0.0.9 lib/chicago/etl/screens/invalid_element.rb