Class: Web3::Eth::Log

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log) ⇒ Log

Returns a new instance of Log.



8
9
10
11
12
13
14
15
16
# File 'lib/web3ethereum/log.rb', line 8

def initialize log
  @raw_data = log

  log.each do |k, v|
    self.instance_variable_set("@#{k}", v)
    self.class.send(:define_method, k, proc {self.instance_variable_get("@#{k}")})
  end

end

Instance Attribute Details

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



6
7
8
# File 'lib/web3ethereum/log.rb', line 6

def raw_data
  @raw_data
end

Instance Method Details

#has_topics?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/web3ethereum/log.rb', line 18

def has_topics?
  !!topics.first
end

#indexed_argsObject



26
27
28
# File 'lib/web3ethereum/log.rb', line 26

def indexed_args
  topics[1...topics.size].collect{|x| x[2..65]}
end

#method_hashObject



22
23
24
# File 'lib/web3ethereum/log.rb', line 22

def method_hash
  topics.first && topics.first[2..65]
end