diff --git a/src/radix/node.cr b/src/radix/node.cr index 2512327..28e83cf 100644 --- a/src/radix/node.cr +++ b/src/radix/node.cr @@ -27,10 +27,10 @@ module Radix # # => [3, 2, 1] # ``` class Node - getter :key - getter? :placeholder - property! :payload - property :children + getter key : String + getter? placeholder : Bool + property! payload + property children : Array(Node) # Returns the priority of the Node based on it's *key* # @@ -54,7 +54,7 @@ module Radix # Node.new(":query").priority # # => 1 # ``` - getter :priority + getter priority : Int32 # Instantiate a Node # diff --git a/src/radix/result.cr b/src/radix/result.cr index 8064d8e..d58fc0f 100644 --- a/src/radix/result.cr +++ b/src/radix/result.cr @@ -13,8 +13,8 @@ module Radix # A Result is also used recursively by `Tree#find` when collecting extra # information like *params*. class Result - getter :params - getter! :payload + getter params + getter! payload # :nodoc: def initialize @@ -35,7 +35,7 @@ module Radix # result.found? # # => true # ``` - def found? + def found? : Bool payload? ? true : false end @@ -60,7 +60,7 @@ module Radix # result.key # # => "" # ``` - def key + def key : String return @key if @key key = String.build { |io| diff --git a/src/radix/tree.cr b/src/radix/tree.cr index 709b764..fd44954 100644 --- a/src/radix/tree.cr +++ b/src/radix/tree.cr @@ -30,7 +30,7 @@ module Radix # Returns the root `Node` element of the Tree. # # On a new tree instance, this will be a placeholder. - getter :root + getter root : Node def initialize @root = Node.new("", placeholder: true) @@ -397,7 +397,7 @@ module Radix end # :nodoc: - private def deprecation(message) + private def deprecation(message : String) STDERR.puts message STDERR.flush end