class Dashbeautiful::Device

description TODO

Attributes

mac[R]
model[R]
name[R]
network[R]
serial[R]
tags[R]

Public Class Methods

all(network) click to toggle source
# File lib/dashbeautiful/device.rb, line 17
def self.all(network)
  raise ArgumentError, 'must pass a Network' if network.nil?

  network.devices
end
create(*args, **kwargs) click to toggle source
# File lib/dashbeautiful/device.rb, line 6
def self.create(*args, **kwargs)
  type = case kwargs[:model]
         when /MV/ then CameraDevice
         when /MS/ then SwitchDevice
         when /MR/ then WirelessDevice
         when /MX/ then ApplianceDevice
         else Device
         end
  type.new(*args, **kwargs)
end
new(network, **attributes) click to toggle source
# File lib/dashbeautiful/device.rb, line 23
def initialize(network, **attributes)
  @network = network
  @name = attributes[:name]
  @serial = attributes[:serial]
  @mac = attributes[:mac]
  @model = attributes[:model]
  @tags = attributes[:tags]
end