Methods

Constants

SET = Struct.new(:symbols).new([ :html, :text, :js, :css, :xml, :json ])

Attributes

[R] symbol

Class Public methods

[](type)

📝 Source code
# File actionview/lib/action_view/template/types.rb, line 11
        def self.[](type)
          if type.is_a?(self)
            type
          else
            new(type)
          end
        end
🔎 See on GitHub

new(symbol)

📝 Source code
# File actionview/lib/action_view/template/types.rb, line 21
        def initialize(symbol)
          @symbol = symbol.to_sym
        end
🔎 See on GitHub

Instance Public methods

==(type)

📝 Source code
# File actionview/lib/action_view/template/types.rb, line 35
        def ==(type)
          @symbol == type.to_sym unless type.blank?
        end
🔎 See on GitHub

ref()

Also aliased as: to_sym
📝 Source code
# File actionview/lib/action_view/template/types.rb, line 30
        def ref
          @symbol
        end
🔎 See on GitHub

to_s()

Also aliased as: to_str
📝 Source code
# File actionview/lib/action_view/template/types.rb, line 25
        def to_s
          @symbol.to_s
        end
🔎 See on GitHub

to_str()

Alias for: to_s

to_sym()

Alias for: ref