abstract class Object
Overview
Object
is the base type of all Crystal objects.
Defined in:
object/methods.crobject/pipe.cr
object/selftap.cr
Instance Method Summary
- #methods : Array(String)
-
#pipe(&)
Pipes itself
-
#selftap(&)
Taps into itself
Instance Method Detail
def pipe(&)
#
Pipes itself
Helpful in writing method-chain pipelines when adding a method to the isn't preferred.
"hello"
.pipe { |x| Base64.encode(x) }
.pipe { |y| puts(y) }
def selftap(&)
#
Taps into itself
This is for use with APIs that are geared more towards a DSL approach, changing the default method receiver.
class Person
def say_hello
puts "hello"
end
end
Person.new.selftap do
say_hello
end