Sha256: dd82192452d8f08a876b12af952d937f78232c7645cc6a4511b1b37c1d998804

Contents?: true

Size: 1.86 KB

Versions: 3

Compression:

Stored size: 1.86 KB

Contents

require 'netbox_client_ruby/api/dcim/device'
require 'netbox_client_ruby/api/dcim/devices'
require 'netbox_client_ruby/api/dcim/device_role'
require 'netbox_client_ruby/api/dcim/device_roles'
require 'netbox_client_ruby/api/dcim/device_type'
require 'netbox_client_ruby/api/dcim/device_types'
require 'netbox_client_ruby/api/dcim/interface'
require 'netbox_client_ruby/api/dcim/interfaces'
require 'netbox_client_ruby/api/dcim/inventory_item'
require 'netbox_client_ruby/api/dcim/inventory_items'
require 'netbox_client_ruby/api/dcim/manufacturer'
require 'netbox_client_ruby/api/dcim/manufacturers'
require 'netbox_client_ruby/api/dcim/platform'
require 'netbox_client_ruby/api/dcim/platforms'
require 'netbox_client_ruby/api/dcim/rack'
require 'netbox_client_ruby/api/dcim/racks'
require 'netbox_client_ruby/api/dcim/region'
require 'netbox_client_ruby/api/dcim/regions'
require 'netbox_client_ruby/api/dcim/site'
require 'netbox_client_ruby/api/dcim/sites'
require 'netbox_client_ruby/communication'

module NetboxClientRuby
  module DCIM
    {
      devices: Devices,
      device_roles: DeviceRoles,
      device_types: DeviceTypes,
      interfaces: Interfaces,
      inventory_items: InventoryItems,
      manufacturers: Manufacturers,
      platforms: Platforms,
      racks: Racks,
      regions: Regions,
      sites: Sites
    }.each_pair do |method_name, class_name|
      define_method(method_name) { class_name.new }
      module_function(method_name)
    end

    {
      device: Device,
      device_role: DeviceRole,
      device_type: DeviceType,
      interface: Interface,
      inventory_item: InventoryItem,
      manufacturer: Manufacturer,
      platform: Platform,
      rack: Rack,
      region: Region,
      site: Site
    }.each_pair do |method_name, class_name|
      define_method(method_name) { |id| class_name.new id }
      module_function(method_name)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netbox-client-ruby-0.1.2 lib/netbox_client_ruby/api/dcim.rb
netbox-client-ruby-0.1.1 lib/netbox_client_ruby/api/dcim.rb
netbox-client-ruby-0.1.0 lib/netbox_client_ruby/api/dcim.rb