Grid(T)
Inherits Enumerable < Iterable < Reference < Object
A simple grid class that can be indexed by Pnt.
Constructors
new(n : Int32, m : Int32, & : Int32, Int32 -> T)
Sourcenew(n : Int32, m : Int32, value : T)
Sourcenew(data : Array(Array(T)))
SourceClass methods
Instance methods
[](i : Int32, j : Int32) : T
Source[]=(i : Int32, j : Int32, value : T) : T
Sourceeach_row
Sourceeach_row
Sourcefill(value : T)
Sourcemap
Returns an Array with the results of running the block against each element of the collection.
[1, 2, 3].map { |i| i * 10 } # => [10, 20, 30]
to_s(io : IO)
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>