Class: Nem::Model::MosaicLevy

Inherits:
Object
  • Object
show all
Includes:
Nem::Mixin::Assignable
Defined in:
lib/nem/model/mosaic_levy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Nem::Mixin::Assignable

#initialize

Instance Attribute Details

#feeObject (readonly)

Returns the value of attribute fee.



6
7
8
# File 'lib/nem/model/mosaic_levy.rb', line 6

def fee
  @fee
end

#mosaic_idObject (readonly)

Returns the value of attribute mosaic_id.



6
7
8
# File 'lib/nem/model/mosaic_levy.rb', line 6

def mosaic_id
  @mosaic_id
end

#recipientObject (readonly)

Returns the value of attribute recipient.



6
7
8
# File 'lib/nem/model/mosaic_levy.rb', line 6

def recipient
  @recipient
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/nem/model/mosaic_levy.rb', line 6

def type
  @type
end

Class Method Details

.new_from_mosaic_levy(hash) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/nem/model/mosaic_levy.rb', line 11

def self.new_from_mosaic_levy(hash)
  return nil if hash.empty?
  mosaic_id = MosaicId.new_from_mosaic_id(hash[:mosaicId])
  new(
    fee: hash[:fee],
    recipient: hash[:recipient],
    type: hash[:type],
    mosaic_id: mosaic_id
  )
end

Instance Method Details

#to_hashObject



22
23
24
25
26
27
28
29
# File 'lib/nem/model/mosaic_levy.rb', line 22

def to_hash
  {
    fee: fee,
    recipient: recipient,
    type: type,
    mosaicId: mosaic_id.to_hash
  }
end