Class: Library::Component

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

Instance Method Summary collapse

Constructor Details

#initialize(file, rootDirectory, rootPath) ⇒ Component

Returns a new instance of Component.



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

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

Instance Method Details

#pathsObject



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

def paths
  parseLinks(@file, @rootDirectory)
end

#rawObject



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

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

#renderObject



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

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