Godot::Dictionary
Inherits Enumerable < Reference < Object
A high-level Crystal wrapper around Godot's native Dictionary type. Provides seamless indexing, Enumerable iteration, and conversion to/from Crystal Hash.
Constructors
Creates a Godot::Dictionary from any Crystal Hash
new
SourceInstance methods
clear
Sourcedelete(key : String) : String | Nil
Sourceempty?
Returns true if self does not contain any element.
([] of Int32).empty? # => true
([1]).empty? # => false
[nil, false].empty? # => false
#present?returns the inverse.
has_key?(key : String) : Bool
Sourcekeys
Sourceto_s(io : IO) : Void
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>
values
Source