Class: Ethmo::Transaction
- Inherits:
-
Hash
- Object
- Hash
- Ethmo::Transaction
- Defined in:
- lib/ethmo/transaction.rb
Overview
:nodoc:
Instance Method Summary collapse
- #contract? ⇒ Boolean
- #from ⇒ Object
-
#initialize(hash) ⇒ Transaction
constructor
A new instance of Transaction.
- #to ⇒ Object
- #transfer? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(hash) ⇒ Transaction
Returns a new instance of Transaction.
6 7 8 9 10 |
# File 'lib/ethmo/transaction.rb', line 6 def initialize(hash) # TODO: Add read transaction from hash support # NOTE: Current only support direct merge transaction merge! hash end |
Instance Method Details
#contract? ⇒ Boolean
16 17 18 |
# File 'lib/ethmo/transaction.rb', line 16 def contract? to.nil? end |
#from ⇒ Object
20 21 22 |
# File 'lib/ethmo/transaction.rb', line 20 def from self['from'] end |
#to ⇒ Object
24 25 26 |
# File 'lib/ethmo/transaction.rb', line 24 def to self['to'] end |
#transfer? ⇒ Boolean
12 13 14 |
# File 'lib/ethmo/transaction.rb', line 12 def transfer? value.positive? end |