Class: Mintaka::Page
- Inherits:
-
Object
- Object
- Mintaka::Page
- Defined in:
- lib/mintaka/page.rb
Instance Attribute Summary collapse
-
#content_path ⇒ Object
readonly
Returns the value of attribute content_path.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(content_path, file_path) ⇒ Page
constructor
A new instance of Page.
- #valid? ⇒ Boolean
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_path ⇒ Object (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_path ⇒ Object (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
#id ⇒ Object
10 11 12 |
# File 'lib/mintaka/page.rb', line 10 def id file_path.gsub(content_path, "").gsub(html_file_pattern, "") end |
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/mintaka/page.rb', line 14 def valid? exists? && file_in_content_path? && !directory? && !partial? && html? end |