Class: CodeAnalyzer::Nil

Inherits:
Object
  • Object
show all
Defined in:
lib/code_analyzer/nil.rb

Overview

Fake nil.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object

return self.



31
32
33
# File 'lib/code_analyzer/nil.rb', line 31

def method_missing(method_sym, *arguments, &block)
  self
end

Instance Method Details

#array_sizeObject

array_size is 0.



11
12
13
# File 'lib/code_analyzer/nil.rb', line 11

def array_size
  0
end

#blank?Boolean

true

Returns:

  • (Boolean)


26
27
28
# File 'lib/code_analyzer/nil.rb', line 26

def blank?
  true
end

#hash_sizeObject

hash_size is 0.



6
7
8
# File 'lib/code_analyzer/nil.rb', line 6

def hash_size
  0
end

#present?Boolean

false

Returns:

  • (Boolean)


21
22
23
# File 'lib/code_analyzer/nil.rb', line 21

def present?
  false
end

#to_sObject

return self for to_s.



16
17
18
# File 'lib/code_analyzer/nil.rb', line 16

def to_s
  self
end