Class: ActionView::Template::RawFile
- Inherits:
-
Object
- Object
- ActionView::Template::RawFile
show all
- Defined in:
- lib/action_view/template/raw_file.rb
Overview
Action View RawFile Template
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(filename) ⇒ RawFile
9
10
11
12
13
14
|
# File 'lib/action_view/template/raw_file.rb', line 9
def initialize(filename)
@filename = filename.to_s
extname = ::File.extname(filename).delete(".")
@type = Template::Types[extname] || Template::Types[:text]
@format = @type.symbol
end
|
Instance Attribute Details
7
8
9
|
# File 'lib/action_view/template/raw_file.rb', line 7
def format
@format
end
|
#type ⇒ Object
7
8
9
|
# File 'lib/action_view/template/raw_file.rb', line 7
def type
@type
end
|
Instance Method Details
#identifier ⇒ Object
16
17
18
|
# File 'lib/action_view/template/raw_file.rb', line 16
def identifier
@filename
end
|
#render(*args) ⇒ Object
20
21
22
|
# File 'lib/action_view/template/raw_file.rb', line 20
def render(*args)
::File.read(@filename)
end
|
#supports_streaming? ⇒ Boolean
24
25
26
|
# File 'lib/action_view/template/raw_file.rb', line 24
def supports_streaming?
false
end
|