Class: Nem::Transaction::ProvisionNamespace

Inherits:
Base
  • Object
show all
Defined in:
lib/nem/transaction/provision_namespace.rb

Constant Summary collapse

TYPE =

8193 (provision namespace transaction)

0x2001

Constants inherited from Base

Base::NETWORK

Instance Attribute Summary collapse

Attributes inherited from Base

#deadline, #fee, #signature, #signer, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Base

#network, #version

Constructor Details

#initialize(new_part, parent = nil, network: nil) ⇒ ProvisionNamespace



12
13
14
15
16
17
18
19
20
21
# File 'lib/nem/transaction/provision_namespace.rb', line 12

def initialize(new_part, parent = 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)
end

Instance Attribute Details

#new_partObject (readonly)

Returns the value of attribute new_part.



6
7
8
# File 'lib/nem/transaction/provision_namespace.rb', line 6

def new_part
  @new_part
end

#parentObject (readonly)

Returns the value of attribute parent.



6
7
8
# File 'lib/nem/transaction/provision_namespace.rb', line 6

def parent
  @parent
end

#rental_feeObject (readonly)

Returns the value of attribute rental_fee.



6
7
8
# File 'lib/nem/transaction/provision_namespace.rb', line 6

def rental_fee
  @rental_fee
end

#rental_fee_sinkObject (readonly)

Returns the value of attribute rental_fee_sink.



6
7
8
# File 'lib/nem/transaction/provision_namespace.rb', line 6

def rental_fee_sink
  @rental_fee_sink
end

Instance Method Details

#root?Boolean



23
24
25
# File 'lib/nem/transaction/provision_namespace.rb', line 23

def root?
  !!(@parent == nil)
end

#sub?Boolean



27
28
29
# File 'lib/nem/transaction/provision_namespace.rb', line 27

def sub?
  !!(@parent && @new_part)
end

#to_hashObject

attributes must be CAMEL CASE for NIS params



32
33
34
35
36
37
38
39
# File 'lib/nem/transaction/provision_namespace.rb', line 32

def to_hash
  {
    newPart: new_part,
    parent: parent,
    rentalFeeSink: rental_fee_sink,
    rentalFee: rental_fee
  }
end