abstract class Object

Overview

Object is the base type of all Crystal objects.

Defined in:

object/methods.cr
object/pipe.cr
object/selftap.cr

Instance Method Summary

Instance Method Detail

def methods : Array(String) #

[View source]
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) }

[View source]
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

[View source]