Class: PufferPages::Liquid::PageDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- PufferPages::Liquid::PageDrop
- Defined in:
- lib/puffer_pages/liquid/page_drop.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #ancestor? ⇒ Boolean
- #before_method(name) ⇒ Object
- #current? ⇒ Boolean
-
#initialize(page) ⇒ PageDrop
constructor
A new instance of PageDrop.
- #name ⇒ Object
- #path ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(page) ⇒ PageDrop
Returns a new instance of PageDrop.
8 9 10 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 8 def initialize page @page = page end |
Instance Method Details
#==(other) ⇒ Object
40 41 42 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 40 def == other page == other.send(:page) end |
#ancestor? ⇒ Boolean
36 37 38 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 36 def ancestor? current_page && page.is_ancestor_of?(current_page) end |
#before_method(name) ⇒ Object
44 45 46 47 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 44 def before_method name page_part = page.inherited_page_part(name) page_part.handle(@context) if page_part && @context end |
#current? ⇒ Boolean
32 33 34 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 32 def current? current_page && page == current_page end |
#name ⇒ Object
12 13 14 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 12 def name @context ? page.render(page.name, @context) : page.name end |
#path ⇒ Object
24 25 26 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 24 def path controller.puffer_pages.puffer_page_path page.to_location end |
#url ⇒ Object
28 29 30 |
# File 'lib/puffer_pages/liquid/page_drop.rb', line 28 def url controller.puffer_pages.puffer_page_url page.to_location end |