Class: Mayu::Routing::Builder

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mayu/routing/builder.rb

Constant Summary collapse

IGNORE =
T.let(%w[. ..].freeze, T::Array[String])
EXTENSIONS =
T.let(%w[.rb .haml].freeze, T::Array[String])

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Builder

Returns a new instance of Builder.



18
19
20
# File 'lib/mayu/routing/builder.rb', line 18

def initialize(root)
  @root = T.let(File.expand_path(root), String)
end

Class Method Details

.build(root) ⇒ Object



13
14
15
# File 'lib/mayu/routing/builder.rb', line 13

def self.build(root)
  new(root).build
end

Instance Method Details

#buildObject



23
24
25
# File 'lib/mayu/routing/builder.rb', line 23

def build
  traverse_directory(Routes::Route.new, path: [])
end