Class: Nem::Model::MosaicOwned

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Nem::Mixin::Assignable

#initialize

Instance Attribute Details

#mosaicsObject (readonly)

Returns the value of attribute mosaics.



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

def mosaics
  @mosaics
end

Class Method Details

.new_from_mosaic_owned(hash) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/nem/model/mosaic_owned.rb', line 8

def self.new_from_mosaic_owned(hash)
  mosaics = hash[:data].inject({}) do |memo, mos|
    mosaic = Mosaic.new_from_mosaic(mos)
    memo[mosaic.fqn] = mosaic
    memo
  end
  new(mosaics: mosaics)
end

Instance Method Details

#find(fqn) ⇒ Object



17
18
19
# File 'lib/nem/model/mosaic_owned.rb', line 17

def find(fqn)
  mosaics[fqn]
end