Class: Web3::Eth::Log
- Inherits:
-
Object
- Object
- Web3::Eth::Log
- Defined in:
- lib/web3ethereum/log.rb
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Instance Method Summary collapse
- #has_topics? ⇒ Boolean
- #indexed_args ⇒ Object
-
#initialize(log) ⇒ Log
constructor
A new instance of Log.
- #method_hash ⇒ Object
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_data ⇒ Object (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
18 19 20 |
# File 'lib/web3ethereum/log.rb', line 18 def has_topics? !!topics.first end |
#indexed_args ⇒ Object
26 27 28 |
# File 'lib/web3ethereum/log.rb', line 26 def indexed_args topics[1...topics.size].collect{|x| x[2..65]} end |
#method_hash ⇒ Object
22 23 24 |
# File 'lib/web3ethereum/log.rb', line 22 def method_hash topics.first && topics.first[2..65] end |