Exception: Parametric::InvalidStructError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/parametric/struct.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(struct) ⇒ InvalidStructError

Returns a new instance of InvalidStructError.



6
7
8
9
10
11
12
# File 'lib/parametric/struct.rb', line 6

def initialize(struct)
  @errors = struct.errors
  msg = @errors.map do |k, strings|
    "#{k} #{strings.join(', ')}"
  end.join('. ')
  super "#{struct.class} is not a valid struct: #{msg}"
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/parametric/struct.rb', line 5

def errors
  @errors
end