Class: Web3::Hpb::Log
- Inherits:
-
Object
- Object
- Web3::Hpb::Log
- Defined in:
- lib/web3/hpb/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.
7 8 9 10 11 12 13 |
# File 'lib/web3/hpb/log.rb', line 7 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.
5 6 7 |
# File 'lib/web3/hpb/log.rb', line 5 def raw_data @raw_data end |
Instance Method Details
#has_topics? ⇒ Boolean
15 16 17 |
# File 'lib/web3/hpb/log.rb', line 15 def has_topics? !!topics.first end |
#indexed_args ⇒ Object
23 24 25 |
# File 'lib/web3/hpb/log.rb', line 23 def indexed_args topics[1...topics.size].collect{ |x| x[2..65] } end |
#method_hash ⇒ Object
19 20 21 |
# File 'lib/web3/hpb/log.rb', line 19 def method_hash topics.first && topics.first[2..65] end |