Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/universum/address.rb

Instance Method Summary collapse

Instance Method Details

#send(value) ⇒ Object



64
65
66
67
68
69
70
71
72
73
# File 'lib/universum/address.rb', line 64

def send( value )
  ## check if self is an address
  if self.start_with?( '0x' )
    ## fix/fix/fix:  use Address[self] lookup!!!!
    ##   do NOT use Account any longer
    Account[self].address.send( value )
  else
    raise "(Auto-)Type Conversion from Address (Hex) String to Account Failed; Expected String Starting with 0x got #{self}; Contract Halted (Stopped)"
  end
end

#transfer(value) ⇒ Object



53
54
55
56
57
58
59
60
61
62
# File 'lib/universum/address.rb', line 53

def transfer( value )
  ## check if self is an address
  if self.start_with?( '0x' )
    ## fix/fix/fix:  use Address[self] lookup!!!!
    ##   do NOT use Account any longer
    Account[self].address.transfer( value )
  else
    raise "(Auto-)Type Conversion from Address (Hex) String to Account Failed; Expected String Starting with 0x got #{self}; Contract Halted (Stopped)"
  end
end