class

KDL::Document

Inherits Enumerable < Reference < Object

Constructors

new(nodes : Array(KDL::Node) = [] of Node, *, comment : String | Nil = nil)
Source

Instance methods

<<(node)
Source
==(other)

Returns false (other can only be a Value here).

Source
[](index : Int)
Source
[](key : String)
Source
[](key : Symbol)
Source
[]?(index : Int)
Source
[]?(key : String)
Source
[]?(key : Symbol)
Source
arg(key) : Value::Type
Source
arg?(key) : Value::Type | Nil
Source
comment
Source
comment=(comment : Nil | String)
Source
dash_vals(key) : Array(Value::Type)
Source
dash_vals?(key) : Array(Value::Type) | Nil
Source
each

Must yield this collection's elements to the block.

Source
empty?

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.
Source
hash(hasher)

See Object#hash(hasher)

Source
nodes
Source
nodes=(nodes : Array(KDL::Node))
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source