Class: HighVoltage::PageFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/high_voltage/page_finder.rb

Overview

A command for finding pages by id. This encapsulates the concepts of mapping page names to file names.

Constant Summary collapse

VALID_CHARACTERS =
"a-zA-Z0-9~!@$%^&*()#`_+-=<>\"{}|[];',?".freeze

Instance Method Summary collapse

Constructor Details

#initialize(page_id) ⇒ PageFinder

Returns a new instance of PageFinder.



7
8
9
# File 'lib/high_voltage/page_finder.rb', line 7

def initialize(page_id)
  @page_id = page_id
end

Instance Method Details

#content_pathObject



17
18
19
# File 'lib/high_voltage/page_finder.rb', line 17

def content_path
  HighVoltage.content_path
end

#findObject

Produce a template path to the page, in a format understood by ‘render :template => find`



13
14
15
# File 'lib/high_voltage/page_finder.rb', line 13

def find
  "#{content_path}#{clean_path}"
end