Class: Razor::GenerableFile
Instance Attribute Summary
Attributes inherited from Generable
#parent, #src_name
Instance Method Summary
collapse
Methods inherited from Generable
#dest, #http, #initialize, #src, #url
Instance Method Details
#contents ⇒ Object
39
40
41
|
# File 'lib/razor/generable.rb', line 39
def contents
File.read(src, :mode=>'rb')
end
|
#dest_ext ⇒ Object
51
52
53
|
# File 'lib/razor/generable.rb', line 51
def dest_ext
File.extname(dest_name)
end
|
#generate ⇒ Object
43
44
45
|
# File 'lib/razor/generable.rb', line 43
def generate
File.open(dest, 'wb') { |f| f << contents }
end
|
#request ⇒ Object
47
48
49
|
# File 'lib/razor/generable.rb', line 47
def request
self
end
|