Class: ActionView::Template::Text

Inherits:
String show all
Defined in:
actionpack/lib/action_view/template/text.rb

Overview

:nodoc:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from String

#acts_like_string?, #as_json, #at, #blank?, #camelize, #classify, #constantize, #dasherize, #demodulize, #encode_json, #encoding_aware?, #exclude?, #first, #foreign_key, #from, #html_safe, #humanize, #inquiry, #is_utf8?, #last, #mb_chars, #ord, #parameterize, #pluralize, #singularize, #squish, #squish!, #strip_heredoc, #tableize, #titleize, #to, #to_date, #to_datetime, #to_time, #truncate, #underscore

Constructor Details

- (Text) initialize(string, mime_type = nil)



7
8
9
10
11
# File 'actionpack/lib/action_view/template/text.rb', line 7

def initialize(string, mime_type = nil)
  super(string.to_s)
  @mime_type   = Mime[mime_type] || mime_type if mime_type
  @mime_type ||= Mime::TEXT
end

Instance Attribute Details

- (Object) mime_type

Returns the value of attribute mime_type



5
6
7
# File 'actionpack/lib/action_view/template/text.rb', line 5

def mime_type
  @mime_type
end

Instance Method Details

- (Object) formats



25
26
27
# File 'actionpack/lib/action_view/template/text.rb', line 25

def formats
  [@mime_type.to_sym]
end

- (Object) identifier



13
14
15
# File 'actionpack/lib/action_view/template/text.rb', line 13

def identifier
  'text template'
end

- (Object) inspect



17
18
19
# File 'actionpack/lib/action_view/template/text.rb', line 17

def inspect
  'text template'
end

- (Object) render(*args)



21
22
23
# File 'actionpack/lib/action_view/template/text.rb', line 21

def render(*args)
  to_s
end