Method: TypeError#type_data
- Defined in:
- lib/dsl/monkeypatches.rb
#type_data ⇒ Hash
Parses the error string and returns the machine-readable expected arguments classes.
194 195 196 197 198 199 200 |
# File 'lib/dsl/monkeypatches.rb', line 194 def type_data # ⇒ can't convert Hash into Integer # There are two ways to match: either rely on us locale, or find the uppercased classes /[^[A-Z]]*(?<given>[A-Z]\w*)[^[A-Z]]*(?<required>[A-Z]\w*)/.match(self.to_s) { |m| { :given => m[:given], :required => m[:required] } } end |