Class: Lurtz::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/lurtz/page.rb

Defined Under Namespace

Classes: NotFound

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

.pathObject

Returns the value of attribute path.



16
17
18
# File 'lib/lurtz/page.rb', line 16

def path
  @path
end

Instance Attribute Details

#disk_pathObject (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

.pagesObject



18
# File 'lib/lurtz/page.rb', line 18

def pages; @pages ||= {} end