Method: Filigree::Commands::ClassMethods#reify_namespace
- Defined in:
- lib/filigree/commands.rb
#reify_namespace(tokens, root: @commands) ⇒ Array<(Hash<Symbol, Hash>, Array<String>)>
Find or create the namespace specified by tokens.
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/filigree/commands.rb', line 184 def reify_namespace(tokens, root: @commands) if tokens.empty? root else curr_token = tokens.shift ns = root[curr_token] ns = root[curr_token] = Hash.new if ns.nil? reify_namespace(tokens, root: ns) end end |