struct
LuckyRouter::CompiledParams
- LuckyRouter::CompiledParams
- Struct
- Value
- Object
Overview
Read-only path parameters from a compiled match, in the same iteration order as a live match's hash. Use #to_h to obtain an independently mutable copy.
Included Modules
Defined in:
lucky_router/compiled_params.crConstructors
Instance Method Summary
- #==(other : CompiledParams | Hash) : Bool
- #[](name) : String
- #[]?(name) : String | Nil
-
#each(& : Pair -> ) : Nil
Must yield this collection's elements to the block.
-
#empty? : Bool
Returns
trueifselfdoes not contain any element. - #fetch(name, default)
- #fetch(name, &)
- #has_key?(name) : Bool
-
#hash(hasher)
See
Object#hash(hasher) - #keys : Array(String)
-
#size : Int32
Returns the number of elements in the collection.
-
#to_h : Hash(String, String)
Creates a
Hashout of an Enumerable where each element is a 2 element structure (for instance aTupleor anArray). - #values : Array(String)
Constructor Detail
Instance Method Detail
Must yield this collection's elements to the block.
def empty? : Bool
#
Returns true if self does not contain any element.
([] of Int32).empty? # => true
([1]).empty? # => false
[nil, false].empty? # => false
#present?returns the inverse.
Creates a Hash out of an Enumerable where each element is a
2 element structure (for instance a Tuple or an Array).
[[:a, :b], [:c, :d]].to_h # => {:a => :b, :c => :d}
Tuple.new({:a, 1}, {:c, 2}).to_h # => {:a => 1, :c => 2}