Module: Kernel
- Defined in:
- lib/xqsr3/doc_.rb,
lib/xqsr3/extensions/kernel/integer.rb,
lib/xqsr3/extensions/kernel/raise_with_options.rb
Overview
Standard module, extended with methods:
- Kernel::Integer
- Kernel#raise_with_options
Instance Method Summary collapse
-
#Integer(arg, base = 0, **options, &block) ⇒ Object
A monkey-patch extension of
Kernel#Integerwithoptions. -
#raise_with_options(*args, **options) ⇒ Object
Extends
Kernelmodule with the ::Xqsr3::Diagnostics::ExceptionUtilities::raise_with_options method.
Instance Method Details
#Integer(arg, base = 0, **options, &block) ⇒ Object
A monkey-patch extension of Kernel#Integer with options
Signature
-
Parameters:
argThe argument to be converted (toFixnumorBignum);baseA value of 0, or between 2 and 36. Defaults to 0;options(+Hash+) Options that control the behaviour of the method;blockAn optional caller-supplied block that will be invoked with theArgumentErrorexception, allowing the caller to take additional action. If the block returns then its return value will be returned to the caller;
-
Options:
:defaultA default value to be used whenargisnilor cannot be converted by (the original)Kernel#Integer;:nilReturnsnilifargisnilor cannot be converted by (the original)Kernel#Integer. Ignored if:defaultis specified;
71 72 73 74 |
# File 'lib/xqsr3/extensions/kernel/integer.rb', line 71 def Integer(arg, base = 0, **, &block) ::Xqsr3::Conversion::IntegerParser.to_integer arg, base = 0, **, &block end |
#raise_with_options(*args, **options) ⇒ Object
Extends Kernel module with the ::Xqsr3::Diagnostics::ExceptionUtilities::raise_with_options
method
58 59 60 61 62 63 |
# File 'lib/xqsr3/extensions/kernel/raise_with_options.rb', line 58 def *args, ** ||= {} ::Xqsr3::Diagnostics::ExceptionUtilities.(*args, **(.merge({ :called_indirectly_06d353cb_5a6c_47ca_8dbe_ff76359c7e96 => 1}))) end |