Class: Lurtz::Page
- Inherits:
-
Object
- Object
- Lurtz::Page
- Defined in:
- lib/lurtz/page.rb
Defined Under Namespace
Classes: NotFound
Class Attribute Summary collapse
-
.path ⇒ Object
Returns the value of attribute path.
Instance Attribute Summary collapse
-
#disk_path ⇒ Object
readonly
Returns the value of attribute disk_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(path) ⇒ Page
Returns a new instance of Page.
44 45 46 |
# File 'lib/lurtz/page.rb', line 44 def initialize(path) @disk_path = path end |
Class Attribute Details
.path ⇒ Object
Returns the value of attribute path.
16 17 18 |
# File 'lib/lurtz/page.rb', line 16 def path @path end |
Instance Attribute Details
#disk_path ⇒ Object (readonly)
Returns the value of attribute disk_path.
42 43 44 |
# File 'lib/lurtz/page.rb', line 42 def disk_path @disk_path end |
Class Method Details
.all(dir_path = path, pattern = "**/*.*") ⇒ Object
20 21 22 |
# File 'lib/lurtz/page.rb', line 20 def all(dir_path = path, pattern = "**/*.*") Dir["#{dir_path}/#{pattern}"].map { |p| Page.new p } end |
.find(web_path) ⇒ Object
24 25 26 |
# File 'lib/lurtz/page.rb', line 24 def find(web_path) pages[web_path] ||= find!(web_path) end |
.pages ⇒ Object
18 |
# File 'lib/lurtz/page.rb', line 18 def pages; @pages ||= {} end |