Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/ruber/utils.rb,
lib/ruber/utils.rb
Instance Method Summary collapse
-
#debug(obj) ⇒ nil
(also: #d)
Prints the given object and the position from which the method was called.
-
#to_array ⇒ Array
Encloses self in an array unless it’s already an array.
Instance Method Details
#debug(obj) ⇒ nil Also known as: d
Prints the given object and the position from which the method was called
101 102 103 |
# File 'lib/ruber/utils.rb', line 101 def debug obj $stderr.puts "DEBUG(#{caller[0][/^[^:]+:\d+/]}): #{obj.inspect}\n" end |
#to_array ⇒ Array
Encloses self in an array unless it’s already an array
Unlike @Kernel#Array@, this doesn’t use the @to_ary@ or @to_a@ methods
124 125 126 |
# File 'lib/ruber/utils.rb', line 124 def to_array [self] end |