Module: Errorio::ClassMethods

Defined in:
lib/errorio.rb

Overview

Class-level methods

Instance Method Summary collapse

Instance Method Details

#errorio_collection_typesObject



148
149
150
# File 'lib/errorio.rb', line 148

def errorio_collection_types
  @errorio_collection_types || [:errors]
end

#errorionize(*collection_types) ⇒ Object



137
138
139
140
141
142
143
144
145
146
# File 'lib/errorio.rb', line 137

def errorionize(*collection_types)
  raise 'InapproriateArguments' unless collection_types.is_a?(Array)

  @errorio_collection_types ||= []
  collection_types.map(&:to_sym).each do |a|
    next if @errorio_collection_types.include?(a)

    @errorio_collection_types << a
  end
end