Class: Remitmd::Transaction
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#block_number ⇒ Object
readonly
Returns the value of attribute block_number.
-
#chain_id ⇒ Object
readonly
Returns the value of attribute chain_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#fee ⇒ Object
readonly
Returns the value of attribute fee.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#memo ⇒ Object
readonly
Returns the value of attribute memo.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
-
#tx_hash ⇒ Object
readonly
Returns the value of attribute tx_hash.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Transaction
constructor
A new instance of Transaction.
Methods inherited from Model
Constructor Details
#initialize(attrs) ⇒ Transaction
Returns a new instance of Transaction.
135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/remitmd/models.rb', line 135 def initialize(attrs) h = attrs.transform_keys(&:to_s) @id = h["id"] @tx_hash = h["tx_hash"] @from = h["from"] @to = h["to"] @amount = decimal(h["amount"]) @fee = decimal(h["fee"] || "0") @memo = h["memo"] || "" @chain_id = h["chain_id"]&.to_i @block_number = h["block_number"].to_i @created_at = parse_time(h["created_at"]) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def amount @amount end |
#block_number ⇒ Object (readonly)
Returns the value of attribute block_number.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def block_number @block_number end |
#chain_id ⇒ Object (readonly)
Returns the value of attribute chain_id.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def chain_id @chain_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def created_at @created_at end |
#fee ⇒ Object (readonly)
Returns the value of attribute fee.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def fee @fee end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def from @from end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def id @id end |
#memo ⇒ Object (readonly)
Returns the value of attribute memo.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def memo @memo end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def to @to end |
#tx_hash ⇒ Object (readonly)
Returns the value of attribute tx_hash.
149 150 151 |
# File 'lib/remitmd/models.rb', line 149 def tx_hash @tx_hash end |