lib/lotus/view/rendering/templates_finder.rb
def find
          _find.map do |template|
            View::Template.new(template)
          end
        end
# Find all the associated templates to the view.
# It recursively looks for templates under the root path of the view,
# that are matching the template name
#
# @return [Array<Lotus::View::Template>] the templates
#
# @api private
# @since 0.1.0
#
# @see Lotus::View::Dsl#root
# @see Lotus::View::Dsl#template
#
# @example
#   require 'lotus/view'
#
#   module Articles
#     class Show
#       include Lotus::View
#     end
#   end
#
#   Articles::Show.root     # => "/path/to/templates"
#   Articles::Show.template # => "articles/show"
#
#   # This view has a template:
#   #
#   #   "/path/to/templates/articles/show.html.erb"
#
#   Lotus::View::Rendering::TemplatesFinder.new(Articles::Show).find
#     # => [#<Lotus::View::Template:0x007f8a0a86a970 ... @file="/path/to/templates/articles/show.html.erb">]
Find all the associated templates to the view.
It recursively looks for templates under the root path of the view,
that are matching the template name
Find all the associated templates to the view . It recursively looks for templates under the root path of the view that are matching the template name
def find
          _find.map do |template|
            View::Template.new(template)
          end
        end
def find _find . map do | template | View :: Template . new ( template ) end end
Find all the associated templates to the view.
Find all the associated templates to the view .
None
Array<Lotus::View::Template>
api
None
since
None
see
None
see
None
example
require 'lotus/view' module Articles class Show include Lotus::View end end Articles::Show.root # => "/path/to/templates" Articles::Show.template # => "articles/show" # This view has a template: # "/path/to/templates/articles/show.html.erb" Lotus::View::Rendering::TemplatesFinder.new(Articles::Show).find # => [#<Lotus::View::Template:0x007f8a0a86a970 ... @file="/path/to/templates/articles/show.html.erb">]
require ' lotus / view ' module Articles class Show include Lotus :: View end end Articles :: Show . root # = > " / path / to / templates " Articles :: Show . template # = > " articles / show " # This view has a template : # " / path / to / templates / articles / show . html . erb " Lotus :: View :: Rendering :: TemplatesFinder . new ( Articles :: Show ) . find # = > [ #<Lotus :: View :: Template : 0x007f8a0a86a970 ... @file = " / path / to / templates / articles / show . html . erb " > ]