Exception: Strict::Base::StrictTypeError
- Inherits:
-
Exception
- Object
- Exception
- Strict::Base::StrictTypeError
- Defined in:
- lib/base.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(error_list) ⇒ StrictTypeError
constructor
A new instance of StrictTypeError.
- #inspect ⇒ Object
Constructor Details
#initialize(error_list) ⇒ StrictTypeError
Returns a new instance of StrictTypeError.
6 7 8 9 10 |
# File 'lib/base.rb', line 6 def initialize(error_list) enforce_primitive!(Array, error_list, "lib/typestrict") error_list.each {|item| enforce_primitive!(String, item, "lib/typestrict")} @errors = error_list end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/base.rb', line 5 def errors @errors end |
Instance Method Details
#inspect ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/base.rb', line 12 def inspect msg = "StrictTypeError#{@errors.size > 1 ? "s" : ""} caught:\n" @errors.each do |e| msg += "#{e}\n" end return msg end |