Class: String

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

Instance Method Summary collapse

Instance Method Details

#send(value) ⇒ Object



126
127
128
129
130
131
132
133
# File 'lib/universum/universum.rb', line 126

def send( value )
  ## check if self is an address
  if self.start_with?( '0x' )
    Account[self].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



117
118
119
120
121
122
123
124
# File 'lib/universum/universum.rb', line 117

def transfer( value )
  ## check if self is an address
  if self.start_with?( '0x' )
    Account[self].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