Class: Nem::Model::MosaicCollection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/nem/model/mosaic_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attachments) ⇒ MosaicCollection

Returns a new instance of MosaicCollection.

Parameters:

  • attachments (Array)


12
13
14
# File 'lib/nem/model/mosaic_collection.rb', line 12

def initialize(attachments)
  @attachments = attachments
end

Instance Attribute Details

#attachmentsObject (readonly)

Returns the value of attribute attachments.



9
10
11
# File 'lib/nem/model/mosaic_collection.rb', line 9

def attachments
  @attachments
end

Instance Method Details

#find_by_fqn(fqn) ⇒ Nem::Model::MosaicAttachment Also known as: []

Parameters:

  • fqn (String)

Returns:



18
19
20
# File 'lib/nem/model/mosaic_collection.rb', line 18

def find_by_fqn(fqn)
  attachments.find { |a| a.fqn == fqn }
end

#find_by_namespace_id(namespace_id) ⇒ Nem::Model::MosaicCollection

Parameters:

  • namespace_id (String)

Returns:



26
27
28
# File 'lib/nem/model/mosaic_collection.rb', line 26

def find_by_namespace_id(namespace_id)
  self.class.new(attachments.select { |a| a.namespace_id == namespace_id })
end