class ActionView::Template::Types::Type - actionview-4.2.4 Documentation

# class ActionView::Template::Types::Type

### Attributes

symbol[R]

### Public Class Methods

[](type) click to toggle source

    # File lib/action_view/template/types.rb, line 17
    def self.[](type)
      return type if type.is_a?(self)

      if type.is_a?(Symbol) || types.member?(type.to_s)
        new(type)
      end
    end

new(symbol) click to toggle source

    # File lib/action_view/template/types.rb, line 27
    def initialize(symbol)
      @symbol = symbol.to_sym
    end

register(*t) click to toggle source

    # File lib/action_view/template/types.rb, line 11
    def self.register(*t)
      types.merge(t.map { |type| type.to_s })
    end

### Public Instance Methods

==(type) click to toggle source

    # File lib/action_view/template/types.rb, line 38
    def ==(type)
      return false if type.blank?
      symbol.to_sym == type.to_sym
    end

ref() click to toggle source

    # File lib/action_view/template/types.rb, line 34
    def ref
      to_sym || to_s
    end