Class: TrueClass

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

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object

:nodoc:



169
170
171
# File 'activesupport/lib/active_support/json/encoding.rb', line 169

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

#blank?Boolean

true is not blank:

true.blank? # => false

Returns:

  • (Boolean)


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

def blank?
  false
end

#duplicable?Boolean

true is not duplicable:

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

Returns:

  • (Boolean)


54
55
56
# File 'activesupport/lib/active_support/core_ext/object/duplicable.rb', line 54

def duplicable?
  false
end

#encode_json(encoder) ⇒ Object

:nodoc:



173
174
175
# File 'activesupport/lib/active_support/json/encoding.rb', line 173

def encode_json(encoder) #:nodoc:
  to_s
end

#to_paramObject

Returns self.



17
18
19
# File 'activesupport/lib/active_support/core_ext/object/to_param.rb', line 17

def to_param
  self
end