Class: Eth::Contract::Event
- Inherits:
-
Object
- Object
- Eth::Contract::Event
- Defined in:
- lib/eth/contract/event.rb
Overview
Provide classes for contract event.
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#event_string ⇒ Object
Returns the value of attribute event_string.
-
#input_types ⇒ Object
Returns the value of attribute input_types.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#signature ⇒ Object
Returns the value of attribute signature.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
Constructor of the Event class.
-
#set_address(address) ⇒ Object
Set the address of the smart contract.
Constructor Details
#initialize(data) ⇒ Event
Constructor of the Eth::Contract::Event class.
27 28 29 30 31 32 33 |
# File 'lib/eth/contract/event.rb', line 27 def initialize(data) @name = data["name"] @input_types = data["inputs"].collect { |x| x["type"] } @inputs = data["inputs"].collect { |x| x["name"] } @event_string = "#{@name}(#{@input_types.join(",")})" @signature = Digest::Keccak.hexdigest(@event_string, 256) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
22 23 24 |
# File 'lib/eth/contract/event.rb', line 22 def address @address end |
#event_string ⇒ Object
Returns the value of attribute event_string.
22 23 24 |
# File 'lib/eth/contract/event.rb', line 22 def event_string @event_string end |
#input_types ⇒ Object
Returns the value of attribute input_types.
22 23 24 |
# File 'lib/eth/contract/event.rb', line 22 def input_types @input_types end |
#inputs ⇒ Object
Returns the value of attribute inputs.
22 23 24 |
# File 'lib/eth/contract/event.rb', line 22 def inputs @inputs end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/eth/contract/event.rb', line 22 def name @name end |
#signature ⇒ Object
Returns the value of attribute signature.
22 23 24 |
# File 'lib/eth/contract/event.rb', line 22 def signature @signature end |