mfm/src/utils/breadcrumbs.cr
Glenn 1f5a2f33ec
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
fix: follow the crystal way for to_s
2024-01-24 00:28:46 +01:00

19 lines
308 B
Crystal

module GX::Utils
class BreadCrumbs
def initialize(base : Array(String))
@ancestors = base
end
def +(other : String)
BreadCrumbs.new(@ancestors + [other])
end
def to_s(io : IO)
io << @ancestors.join(" ")
end
def to_a
@ancestors.clone
end
end
end