Class: Library::Component

Inherits:
Object
  • Object
show all
Defined in:
app/models/library/component.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, rootDirectory) ⇒ Component

Returns a new instance of Component.



3
4
5
6
# File 'app/models/library/component.rb', line 3

def initialize(file, rootDirectory)
  @file = file
  @rootDirectory = rootDirectory
end

Instance Method Details

#pathsObject



16
17
18
# File 'app/models/library/component.rb', line 16

def paths
  parseLinks(@file, @rootDirectory)
end

#rawObject



8
9
10
# File 'app/models/library/component.rb', line 8

def raw
  File.open(@file).read
end

#renderObject



12
13
14
# File 'app/models/library/component.rb', line 12

def render
  parseFile(@file, 'views')
end