Sha256: baaafc45aa403df71d9602fb5c64685e45b33f46762444402b7c06e7ccd22a67

Contents?: true

Size: 459 Bytes

Versions: 13

Compression:

Stored size: 459 Bytes

Contents

module CsvRowModel
  module Concerns
    module InvalidOptions
      extend ActiveSupport::Concern

      class_methods do
        protected
        def check_and_merge_options(options, default_options)
          invalid_options = options.keys - default_options.keys
          raise ArgumentError.new("Invalid option(s): #{invalid_options}") if invalid_options.present?

          options.reverse_merge(default_options)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
csv_row_model-0.4.1 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.4.0 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.10 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.9 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.8 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.7 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.6 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.5 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.4 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.3 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.2 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.1 lib/csv_row_model/concerns/invalid_options.rb
csv_row_model-0.3.0 lib/csv_row_model/concerns/invalid_options.rb