Class: PageReferenceCollector
- Inherits:
-
MediaWikiLinkHandler
- Object
- MediaWikiLinkHandler
- PageReferenceCollector
- Defined in:
- app/models/page.rb
Instance Method Summary collapse
-
#initialize(page) ⇒ PageReferenceCollector
constructor
A new instance of PageReferenceCollector.
- #url_for(page_name) ⇒ Object
Constructor Details
#initialize(page) ⇒ PageReferenceCollector
Returns a new instance of PageReferenceCollector.
205 206 207 208 |
# File 'app/models/page.rb', line 205 def initialize(page) @referer = page @page_provider = DefaultPageProvider.new(Page) end |
Instance Method Details
#url_for(page_name) ⇒ Object
210 211 212 213 214 215 |
# File 'app/models/page.rb', line 210 def url_for(page_name) page = @page_provider.find_by_name(page_name) @referer.references << WikiReference.new(:referer => @referer, :referee => page) page_name end |