Class: NicePartials::Partial::Section
- Inherits:
-
Object
- Object
- NicePartials::Partial::Section
- Defined in:
- lib/nice_partials/partial/section.rb
Instance Method Summary collapse
- #content? ⇒ Boolean
- #content_for(*arguments, &block) ⇒ Object
-
#initialize(view_context) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(view_context) ⇒ Section
Returns a new instance of Section.
2 3 4 5 |
# File 'lib/nice_partials/partial/section.rb', line 2 def initialize(view_context) @view_context = view_context @content = @pending_content = nil end |
Instance Method Details
#content? ⇒ Boolean
16 17 18 |
# File 'lib/nice_partials/partial/section.rb', line 16 def content? pending? || @content end |
#content_for(*arguments, &block) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/nice_partials/partial/section.rb', line 7 def content_for(*arguments, &block) if write_content_for(arguments.first, &block) nil else capture_content_for(*arguments) if pending? @content end end |