Class: Jbuilder::DependencyTracker
- Inherits:
-
Object
- Object
- Jbuilder::DependencyTracker
- Defined in:
- lib/jbuilder/jbuilder_dependency_tracker.rb
Constant Summary collapse
- EXPLICIT_DEPENDENCY =
/# Template Dependency: (\S+)/- DIRECT_RENDERS =
Matches:
json.partial! "messages/message" json.partial!('messages/message') / \w+\.partial! # json.partial! \(?\s* # optional parenthesis (['"])([^'"]+)\1 # quoted value /x
- INDIRECT_RENDERS =
Matches:
json.partial! partial: "comments/comment" json.comments @post.comments, partial: "comments/comment", as: :comment json.array! @posts, partial: "posts/post", as: :post = render partial: "account" / (?::partial\s*=>|partial:) # partial: or :partial => \s* # optional whitespace (['"])([^'"]+)\1 # quoted value /x
Class Method Summary collapse
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(name, template, view_paths = nil) ⇒ DependencyTracker
constructor
A new instance of DependencyTracker.
Constructor Details
#initialize(name, template, view_paths = nil) ⇒ DependencyTracker
Returns a new instance of DependencyTracker.
32 33 34 |
# File 'lib/jbuilder/jbuilder_dependency_tracker.rb', line 32 def initialize(name, template, view_paths = nil) @name, @template, @view_paths = name, template, view_paths end |
Class Method Details
.call(name, template, view_paths = nil) ⇒ Object
28 29 30 |
# File 'lib/jbuilder/jbuilder_dependency_tracker.rb', line 28 def self.call(name, template, view_paths = nil) new(name, template, view_paths).dependencies end |
Instance Method Details
#dependencies ⇒ Object
36 37 38 |
# File 'lib/jbuilder/jbuilder_dependency_tracker.rb', line 36 def dependencies direct_dependencies + indirect_dependencies + explicit_dependencies end |