Class: Symbol

Inherits:
Object show all
Defined in:
lib/active_support/json/encoding.rb,
lib/active_support/core_ext/object/duplicable.rb

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object

:nodoc:



203
204
205
# File 'lib/active_support/json/encoding.rb', line 203

def as_json(options = nil) #:nodoc:
  to_s
end

#duplicable?Boolean

Symbols are not duplicable:

:my_symbol.duplicable? # => false
:my_symbol.dup         # => TypeError: can't dup Symbol

Returns:

  • (Boolean)


64
65
66
# File 'lib/active_support/core_ext/object/duplicable.rb', line 64

def duplicable?
  false
end