Class: Nem::Endpoint::Namespace
- Defined in:
- lib/nem/endpoint/namespace.rb
Instance Method Summary collapse
- #find(namespace) ⇒ Nem::Model::Namespace (also: #get)
- #mosaic_definition(namespace, id: nil, page_size: nil) ⇒ Array <Nem::Model::MosaicDefinition>
- #root(id, page_size: nil) ⇒ Array <Nem::Model::Namespace>
Methods inherited from Base
#current_node, #initialize, #next_node!, #request, #request!
Constructor Details
This class inherits a constructor from Nem::Endpoint::Base
Instance Method Details
#find(namespace) ⇒ Nem::Model::Namespace Also known as: get
6 7 8 9 10 |
# File 'lib/nem/endpoint/namespace.rb', line 6 def find(namespace) request!(:get, '/namespace', namespace: namespace) do |res| Nem::Model::Namespace.new_from_namespace(res) end end |
#mosaic_definition(namespace, id: nil, page_size: nil) ⇒ Array <Nem::Model::MosaicDefinition>
26 27 28 29 30 31 32 33 34 |
# File 'lib/nem/endpoint/namespace.rb', line 26 def mosaic_definition(namespace, id: nil, page_size: nil) request!(:get, '/namespace/mosaic/definition/page', namespace: namespace, id: id, pageSize: page_size ) do |res| res[:data].map { |mdmdp| Nem::Model::MosaicDefinition.(mdmdp) } end end |
#root(id, page_size: nil) ⇒ Array <Nem::Model::Namespace>
16 17 18 19 20 21 22 |
# File 'lib/nem/endpoint/namespace.rb', line 16 def root(id, page_size: nil) request!(:get, '/namespace/root/page', id: id, pageSize: page_size) do |res| res[:data].map do |nsmdp| Nem::Model::Namespace.(nsmdp) end end end |