Class: Ruzbx::Api::Template

Inherits:
Item
  • Object
show all
Defined in:
lib/ruzbx/api/template.rb

Overview

Instance Attribute Summary

Attributes inherited from Item

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Item

#initialize

Constructor Details

This class inherits a constructor from Ruzbx::Api::Item

Class Method Details

.get(names, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/ruzbx/api/template.rb', line 8

def self.get(names, &block)
  entity = Entity.build do
    rpc_method 'template.get'
    data params: { output: 'extend', filter: { host: names } }
    instance_eval(&block) if block_given?
  end
  new(entity.commit)
end

Instance Method Details

#idsObject



17
18
19
# File 'lib/ruzbx/api/template.rb', line 17

def ids
  @data['result'].map { |i| i['templateid'] } unless @data['result'].empty?
end