Sha256: 73335f57d571d484b51bd737ce0dd6179d29b0acaa52b1a38dfa5d9af5863f31
Contents?: true
Size: 608 Bytes
Versions: 44
Compression:
Stored size: 608 Bytes
Contents
# frozen_string_literal: true module ActionView #:nodoc: # = Action View RawFile Template class Template #:nodoc: class RawFile #:nodoc: attr_accessor :type, :format def initialize(filename) @filename = filename.to_s extname = ::File.extname(filename).delete(".") @type = Template::Types[extname] || Template::Types[:text] @format = @type.symbol end def identifier @filename end def render(*args) ::File.read(@filename) end def formats; Array(format); end deprecate :formats end end end
Version data entries
44 entries across 42 versions & 5 rubygems