Class: TrueClass

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

Constant Summary collapse

AS_JSON =
ActiveSupport::JSON::Variable.new('true').freeze

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object

:nodoc:



165
# File 'lib/active_support/json/encoding.rb', line 165

def as_json(options = nil) AS_JSON end

#blank?Boolean

true is not blank:

true.blank? # => false

Returns:

  • (Boolean)


65
66
67
# File 'lib/active_support/core_ext/object/blank.rb', line 65

def blank?
  false
end

#duplicable?Boolean

true is not duplicable:

true.duplicable? # => false
true.dup         # => TypeError: can't dup TrueClass

Returns:

  • (Boolean)


57
58
59
# File 'lib/active_support/core_ext/object/duplicable.rb', line 57

def duplicable?
  false
end

#to_paramObject



15
16
17
# File 'lib/active_support/core_ext/object/to_param.rb', line 15

def to_param
  self
end