Class: ReflexBehaviors::TagBuilders::BaseTagBuilder
- Inherits:
-
Object
- Object
- ReflexBehaviors::TagBuilders::BaseTagBuilder
- Defined in:
- lib/reflex_behaviors/tag_builders/base_tag_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#view_context ⇒ Object
readonly
Returns the value of attribute view_context.
Instance Method Summary collapse
-
#initialize(view_context) ⇒ BaseTagBuilder
constructor
A new instance of BaseTagBuilder.
- #view_stack ⇒ Object
Constructor Details
#initialize(view_context) ⇒ BaseTagBuilder
Returns a new instance of BaseTagBuilder.
9 10 11 |
# File 'lib/reflex_behaviors/tag_builders/base_tag_builder.rb', line 9 def initialize(view_context) @view_context = view_context end |
Instance Attribute Details
#view_context ⇒ Object (readonly)
Returns the value of attribute view_context.
6 7 8 |
# File 'lib/reflex_behaviors/tag_builders/base_tag_builder.rb', line 6 def view_context @view_context end |
Instance Method Details
#view_stack ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/reflex_behaviors/tag_builders/base_tag_builder.rb', line 13 def view_stack prefix = "app/views/" locations = caller_locations.select { |location| location.path.include?(prefix) } locations.each_with_object(Set.new) do |location, memo| memo << location.path[(location.path.index(prefix) + prefix.length)..] end end |