123456789_123456789_123456789_123456789_123456789_

Class: ActionView::Template::RawFile

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: actionview/lib/action_view/template/raw_file.rb

Overview

Action View RawFile Template

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(filename) ⇒ RawFile

[ GitHub ]

  
# File 'actionview/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

#format (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/template/raw_file.rb', line 7

attr_accessor :type, :format

#type (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/template/raw_file.rb', line 7

attr_accessor :type, :format

Instance Method Details

#identifier

[ GitHub ]

  
# File 'actionview/lib/action_view/template/raw_file.rb', line 16

def identifier
  @filename
end

#render(*args)

[ GitHub ]

  
# File 'actionview/lib/action_view/template/raw_file.rb', line 20

def render(*args)
  ::File.read(@filename)
end