struct

BSONCr::ObjectId

Inherits Struct < Value < Object

Constants

BYTES_SIZE = 12

Constructors

new(bytes : StaticArray(UInt8, 12))
Source

Class methods

create
Source
parse(str : String)
Source

Instance methods

bytes
Source
inspect(io : IO)

Appends this struct's name and instance variables names and values to the given IO.

struct Point
  def initialize(@x : Int32, @y : Int32)
  end
end

p1 = Point.new 1, 2
p1.to_s    # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"
Source
to_datetime
Source
to_s(io : IO)

Same as #inspect(io).

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source