class Superstructure::ArgumentErrorBuilder
Public Class Methods
new()
click to toggle source
# File lib/superstructure/argument_error_builder.rb, line 3 def initialize @errors = { extra_params: [], missing_params: [], shadowed_params: [] } end
Public Instance Methods
add_error(type, key)
click to toggle source
# File lib/superstructure/argument_error_builder.rb, line 11 def add_error(type, key) add_errors(type, [key]) end
add_errors(type, key)
click to toggle source
# File lib/superstructure/argument_error_builder.rb, line 15 def add_errors(type, key) @errors.fetch(type).concat(key) end
build()
click to toggle source
# File lib/superstructure/argument_error_builder.rb, line 19 def build ArgumentError.new(@errors) end
error?()
click to toggle source
# File lib/superstructure/argument_error_builder.rb, line 23 def error? @errors.any? { |k, v| v.any? } end