Class: Musako::Renderer
- Inherits:
-
Object
show all
- Defined in:
- lib/musako/renderer.rb
Instance Method Summary
collapse
Constructor Details
#initialize(file) ⇒ Renderer
Returns a new instance of Renderer.
3
4
5
|
# File 'lib/musako/renderer.rb', line 3
def initialize(file)
@original_file = file
end
|
Instance Method Details
#file_extname ⇒ Object
17
18
19
|
# File 'lib/musako/renderer.rb', line 17
def file_extname
@file_extname || ""
end
|
#file_name ⇒ Object
12
13
14
15
|
# File 'lib/musako/renderer.rb', line 12
def file_name
File.basename(@original_file)
.gsub(File.extname(@original_file), self.file_extname)
end
|
#file_path ⇒ Object
25
26
27
|
# File 'lib/musako/renderer.rb', line 25
def file_path
File.new(@original_file).path
end
|
#file_updated_at ⇒ Object
21
22
23
|
# File 'lib/musako/renderer.rb', line 21
def file_updated_at
File.stat(@original_file).mtime
end
|
#original_file_source ⇒ Object
29
30
31
|
# File 'lib/musako/renderer.rb', line 29
def original_file_source
File.open(@original_file, 'r').read
end
|
#render ⇒ Object
8
9
10
|
# File 'lib/musako/renderer.rb', line 8
def render
raise NoImplementationError
end
|