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.



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

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.



7
8
9
# File 'lib/parametric/struct.rb', line 7

def errors
  @errors
end