123456789_123456789_123456789_123456789_123456789_

Class: ActionView::Template::Types::Type

Relationships & Source Files
Inherits: Object
Defined in: actionview/lib/action_view/template/types.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(symbol) ⇒ Type

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 21

def initialize(symbol)
  @symbol = symbol.to_sym
end

Class Method Details

.[](type)

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 11

def self.[](type)
  if type.is_a?(self)
    type
  else
    new(type)
  end
end

Instance Attribute Details

#symbol (readonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 19

attr_reader :symbol

Instance Method Details

#==(type)

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 35

def ==(type)
  @symbol == type.to_sym unless type.blank?
end

#ref Also known as: #to_sym

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 30

def ref
  @symbol
end

#to_s Also known as: #to_str

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 25

def to_s
  @symbol.to_s
end

#to_str

Alias for #to_s.

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 28

alias to_str to_s

#to_sym

Alias for #ref.

[ GitHub ]

  
# File 'actionview/lib/action_view/template/types.rb', line 33

alias to_sym ref