⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (897 Bytes)
Feature #14111
» argument_error.rb
esjee (SJ Stoker)
, 06/25/2018 09:10 PM
module
PrintPrototype
prepend_features
ArgumentError
def
to_s
msg
=
super
.
dup
parameters
=
receiver
.
method
(
method_name
).
parameters
human_friendly_parameters
=
parameters
.
map
do
|
type
,
name
|
# type is one of
# req
# opt
# rest
# key
# keyreq
# keyrest
# block
human_friendly_type
=
case
type
when
:req
"required"
when
:opt
"optional"
when
:rest
"rest"
when
:key
"optional keyword"
when
:keyreq
"required keyword"
when
:keyrest
"rest keyword"
when
:block
"block"
else
type
.
to_s
end
"
\t
#{
name
}
(
#{
human_friendly_type
}
)"
end
if
human_friendly_parameters
.
any?
msg
<<
"
\n\n
Method parameters:
\n
#{
human_friendly_parameters
.
join
"
\n
"
}
"
end
rescue
=>
_e
puts
_e
super
end
end
« Previous
1
2
3
Next »
(3-3/3)
Loading...