Module: Kernel

Defined in:
lib/universum/convert.rb

Overview

note: put all “global” Kernel converter methods into Kernel module

Instance Method Summary collapse

Instance Method Details

#Address(arg) ⇒ Object

e.g. use Address(0)



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/universum/convert.rb', line 9

def Address( arg )
  if arg == 0 || arg == '0x0' || arg == '0x0000'
    '0x0000'   ## note: return a string for now and NOT (typed) Address.zero
  else
    ## assume string (hex) address
    ##  pass through for now
    ##
    ##   use an address lookup in the future - why? why not?
    ##    Address.find_by_address( arg )
    arg
  end
end