Class: Mintaka::Page

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_path, file_path) ⇒ Page

Returns a new instance of Page.



5
6
7
8
# File 'lib/mintaka/page.rb', line 5

def initialize(content_path, file_path)
  @content_path = content_path
  @file_path = file_path
end

Instance Attribute Details

#content_pathObject (readonly)

Returns the value of attribute content_path.



3
4
5
# File 'lib/mintaka/page.rb', line 3

def content_path
  @content_path
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



3
4
5
# File 'lib/mintaka/page.rb', line 3

def file_path
  @file_path
end

Instance Method Details

#idObject



10
11
12
# File 'lib/mintaka/page.rb', line 10

def id
  file_path.gsub(content_path, "").gsub(html_file_pattern, "")
end

#valid?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/mintaka/page.rb', line 14

def valid?
  exists? && file_in_content_path? && !directory? && !partial? && html?
end