Class: Nem::Model::MosaicId

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Nem::Mixin::Assignable

#initialize

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#namespace_idObject (readonly)

Returns the value of attribute namespace_id.



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

def namespace_id
  @namespace_id
end

Class Method Details

.new_from_mosaic_id(hash) ⇒ Object



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

def self.new_from_mosaic_id(hash)
  new(
    namespace_id: hash[:namespaceId],
    name: hash[:name]
  )
end

Instance Method Details

#fqnObject



15
16
17
# File 'lib/nem/model/mosaic_id.rb', line 15

def fqn
  @fqn ||= "#{@namespace_id}:#{@name}"
end

#to_hashObject



19
20
21
22
23
24
# File 'lib/nem/model/mosaic_id.rb', line 19

def to_hash
  {
    namespaceId: namespace_id,
    name: name
  }
end