Class: Nem::Request::Announce
- Inherits:
-
Object
- Object
- Nem::Request::Announce
- Defined in:
- lib/nem/request/announce.rb
Overview
Instance Attribute Summary collapse
-
#keypair ⇒ Nem::Keypair
The current value of keypair.
-
#transaction ⇒ Nem::Model::Transaction
The current value of transaction.
Instance Method Summary collapse
-
#initialize(transaction, keypair) ⇒ Announce
constructor
A new instance of Announce.
-
#to_entity(state = nil) ⇒ Hash
Attribute and value pairs.
Constructor Details
#initialize(transaction, keypair) ⇒ Announce
Returns a new instance of Announce.
10 11 12 13 |
# File 'lib/nem/request/announce.rb', line 10 def initialize(transaction, keypair) @transaction = transaction @keypair = keypair end |
Instance Attribute Details
#keypair ⇒ Nem::Keypair
Returns the current value of keypair.
7 8 9 |
# File 'lib/nem/request/announce.rb', line 7 def keypair @keypair end |
#transaction ⇒ Nem::Model::Transaction
Returns the current value of transaction.
7 8 9 |
# File 'lib/nem/request/announce.rb', line 7 def transaction @transaction end |
Instance Method Details
#to_entity(state = nil) ⇒ Hash
Returns Attribute and value pairs.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nem/request/announce.rb', line 16 def to_entity(state = nil) entity = prepare_entity if Nem.debug Nem.logger.debug '%s' % [entity.inspect] end if state == :prepare { transaction: entity, privateKey: keypair.private } else serialized = serialize(entity) hex_serialized = Nem::Util::Convert.ua2hex(serialized) { data: Nem::Util::Convert.ua2hex(serialized), signature: signature(hex_serialized) } end end |