123456789_123456789_123456789_123456789_123456789_

Class: ActionView::Template::SimpleType

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: actionview/lib/action_view/template/types.rb

Overview

SimpleType is mostly just a stub implementation for when Action View is used without Action Dispatch.

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(symbol) ⇒ SimpleType

[ GitHub ]

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

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

Class Attribute Details

.symbols (readonly)

[ GitHub ]

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

attr_reader :symbols

Class Method Details

.[](type)

[ GitHub ]

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

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

.valid_symbols?(symbols) ⇒ Boolean

:nodoc

[ GitHub ]

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

def valid_symbols?(symbols) # :nodoc
  symbols.all? { |s| @symbols.include?(s) }
end

Instance Attribute Details

#symbol (readonly)

[ GitHub ]

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

attr_reader :symbol

Instance Method Details

#==(type)

[ GitHub ]

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

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 38

def ref
  @symbol
end

#to_s Also known as: #to_str

[ GitHub ]

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

def to_s
  @symbol.to_s
end

#to_str

Alias for #to_s.

[ GitHub ]

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

alias to_str to_s

#to_sym

Alias for #ref.

[ GitHub ]

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

alias to_sym ref