Class: IOTA::Models::Transaction
- Defined in:
- lib/iota/models/transaction.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#attachmentTimestamp ⇒ Object
Returns the value of attribute attachmentTimestamp.
-
#attachmentTimestampLowerBound ⇒ Object
Returns the value of attribute attachmentTimestampLowerBound.
-
#attachmentTimestampUpperBound ⇒ Object
Returns the value of attribute attachmentTimestampUpperBound.
-
#branchTransaction ⇒ Object
Returns the value of attribute branchTransaction.
-
#bundle ⇒ Object
Returns the value of attribute bundle.
-
#currentIndex ⇒ Object
Returns the value of attribute currentIndex.
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#lastIndex ⇒ Object
Returns the value of attribute lastIndex.
-
#nonce ⇒ Object
Returns the value of attribute nonce.
-
#obsoleteTag ⇒ Object
Returns the value of attribute obsoleteTag.
-
#persistence ⇒ Object
Returns the value of attribute persistence.
-
#signatureMessageFragment ⇒ Object
Returns the value of attribute signatureMessageFragment.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#trunkTransaction ⇒ Object
Returns the value of attribute trunkTransaction.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(options) ⇒ Transaction
constructor
A new instance of Transaction.
- #valid? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Transaction
Returns a new instance of Transaction.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/iota/models/transaction.rb', line 6 def initialize() = symbolize_keys() @hash = [:hash] @signatureMessageFragment = [:signatureMessageFragment] @address = [:address] @value = [:value] @obsoleteTag = [:obsoleteTag] @timestamp = [:timestamp] @currentIndex = [:currentIndex] @lastIndex = [:lastIndex] @bundle = [:bundle] @trunkTransaction = [:trunkTransaction] @branchTransaction = [:branchTransaction] @tag = [:tag] @attachmentTimestamp = [:attachmentTimestamp] @attachmentTimestampLowerBound = [:attachmentTimestampLowerBound] @attachmentTimestampUpperBound = [:attachmentTimestampUpperBound] @nonce = [:nonce] @persistence = nil end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def address @address end |
#attachmentTimestamp ⇒ Object
Returns the value of attribute attachmentTimestamp.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def @attachmentTimestamp end |
#attachmentTimestampLowerBound ⇒ Object
Returns the value of attribute attachmentTimestampLowerBound.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def @attachmentTimestampLowerBound end |
#attachmentTimestampUpperBound ⇒ Object
Returns the value of attribute attachmentTimestampUpperBound.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def @attachmentTimestampUpperBound end |
#branchTransaction ⇒ Object
Returns the value of attribute branchTransaction.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def branchTransaction @branchTransaction end |
#bundle ⇒ Object
Returns the value of attribute bundle.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def bundle @bundle end |
#currentIndex ⇒ Object
Returns the value of attribute currentIndex.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def currentIndex @currentIndex end |
#hash ⇒ Object
Returns the value of attribute hash.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def hash @hash end |
#lastIndex ⇒ Object
Returns the value of attribute lastIndex.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def lastIndex @lastIndex end |
#nonce ⇒ Object
Returns the value of attribute nonce.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def nonce @nonce end |
#obsoleteTag ⇒ Object
Returns the value of attribute obsoleteTag.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def obsoleteTag @obsoleteTag end |
#persistence ⇒ Object
Returns the value of attribute persistence.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def persistence @persistence end |
#signatureMessageFragment ⇒ Object
Returns the value of attribute signatureMessageFragment.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def signatureMessageFragment @signatureMessageFragment end |
#tag ⇒ Object
Returns the value of attribute tag.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def tag @tag end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def @timestamp end |
#trunkTransaction ⇒ Object
Returns the value of attribute trunkTransaction.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def trunkTransaction @trunkTransaction end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/iota/models/transaction.rb', line 4 def value @value end |
Instance Method Details
#valid? ⇒ Boolean
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/iota/models/transaction.rb', line 27 def valid? keysToValidate = [ { key: 'hash', validator: :isHash, args: nil}, { key: 'signatureMessageFragment', validator: :isTrytes, args: 2187 }, { key: 'address', validator: :isHash, args: nil }, { key: 'value', validator: :isValue, args: nil }, { key: 'obsoleteTag', validator: :isTrytes, args: 27 }, { key: 'timestamp', validator: :isValue, args: nil }, { key: 'currentIndex', validator: :isValue, args: nil }, { key: 'lastIndex', validator: :isValue, args: nil }, { key: 'bundle', validator: :isHash, args: nil }, { key: 'trunkTransaction', validator: :isHash, args: nil }, { key: 'branchTransaction', validator: :isHash, args: nil }, { key: 'tag', validator: :isTrytes, args: 27 }, { key: 'attachmentTimestamp', validator: :isValue, args: nil }, { key: 'attachmentTimestampLowerBound', validator: :isValue, args: nil }, { key: 'attachmentTimestampUpperBound', validator: :isValue, args: nil }, { key: 'nonce', validator: :isTrytes, args: 27 } ] validator = IOTA::Utils::ObjectValidator.new(keysToValidate) validator.valid?(self) end |