Exception: Parametric::InvalidStructError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Parametric::InvalidStructError
- Defined in:
- lib/parametric/struct.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(struct) ⇒ InvalidStructError
constructor
A new instance of InvalidStructError.
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
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/parametric/struct.rb', line 5 def errors @errors end |