Class: Hobo::Null

Inherits:
Object
  • Object
show all
Defined in:
lib/hobo/null.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



3
4
5
# File 'lib/hobo/null.rb', line 3

def method_missing(method, *args, &block)
  self
end

Instance Method Details

#nil?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/hobo/null.rb', line 7

def nil?
  true
end

#to_aObject



11
12
13
# File 'lib/hobo/null.rb', line 11

def to_a
  []
end

#to_fObject



19
20
21
# File 'lib/hobo/null.rb', line 19

def to_f
  0.0
end

#to_iObject



23
24
25
# File 'lib/hobo/null.rb', line 23

def to_i
  0
end

#to_sObject



15
16
17
# File 'lib/hobo/null.rb', line 15

def to_s
  ""
end