Class: Nem::Transaction::ProvisionNamespace
- Defined in:
- lib/nem/transaction/provision_namespace.rb
Constant Summary collapse
- TYPE =
8193 (provision namespace transaction)
0x2001
Constants inherited from Base
Instance Attribute Summary collapse
-
#new_part ⇒ String
The current value of new_part.
-
#parent ⇒ String
The current value of parent.
-
#rental_fee ⇒ Integer
The current value of rental_fee.
-
#rental_fee_sink ⇒ String
The current value of rental_fee_sink.
Attributes inherited from Base
#deadline, #fee, #signature, #signer, #timestamp, #type
Instance Method Summary collapse
-
#initialize(new_part, parent = nil, timestamp: nil, deadline: nil, network: nil) ⇒ ProvisionNamespace
constructor
A new instance of ProvisionNamespace.
- #root? ⇒ Boolean
- #sub? ⇒ Boolean
-
#to_hash ⇒ Hash
attributes must be CAMEL CASE for NIS params.
Methods inherited from Base
Constructor Details
#initialize(new_part, parent = nil, timestamp: nil, deadline: nil, network: nil) ⇒ ProvisionNamespace
Returns a new instance of ProvisionNamespace.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nem/transaction/provision_namespace.rb', line 12 def initialize(new_part, parent = nil, timestamp: nil, deadline: nil, network: nil) @new_part = new_part @parent = parent @rental_fee = rental[:fee] @rental_fee_sink = rental[:sink] @network = network || Nem.default_network @type = TYPE @fee = Nem::Fee::ProvisionNamespace.new(self) @timestamp = || Time.now @deadline = deadline || Time.now + Nem.default_deadline end |
Instance Attribute Details
#new_part ⇒ String
Returns the current value of new_part.
7 8 9 |
# File 'lib/nem/transaction/provision_namespace.rb', line 7 def new_part @new_part end |
#parent ⇒ String
Returns the current value of parent.
7 8 9 |
# File 'lib/nem/transaction/provision_namespace.rb', line 7 def parent @parent end |
#rental_fee ⇒ Integer
Returns the current value of rental_fee.
7 8 9 |
# File 'lib/nem/transaction/provision_namespace.rb', line 7 def rental_fee @rental_fee end |
#rental_fee_sink ⇒ String
Returns the current value of rental_fee_sink.
7 8 9 |
# File 'lib/nem/transaction/provision_namespace.rb', line 7 def rental_fee_sink @rental_fee_sink end |
Instance Method Details
#root? ⇒ Boolean
26 27 28 |
# File 'lib/nem/transaction/provision_namespace.rb', line 26 def root? !!(@parent == nil) end |
#sub? ⇒ Boolean
31 32 33 |
# File 'lib/nem/transaction/provision_namespace.rb', line 31 def sub? !!(@parent && @new_part) end |
#to_hash ⇒ Hash
attributes must be CAMEL CASE for NIS params
37 38 39 40 41 42 43 44 |
# File 'lib/nem/transaction/provision_namespace.rb', line 37 def to_hash { newPart: new_part, parent: parent, rentalFeeSink: rental_fee_sink, rentalFee: rental_fee } end |