Class: HighVoltage::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/high_voltage/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/high_voltage/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/high_voltage/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/high_voltage/page.rb', line 3

def file_path
  @file_path
end

Instance Method Details

#idObject



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

def id
  file_path.gsub(content_path, "").split(".").first
end

#valid?Boolean

Returns:

  • (Boolean)


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

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