class UnifiProtect::Client

Attributes

api[R]

Public Class Methods

new(api: nil, **args) click to toggle source
# File lib/unifi_protect/client.rb, line 7
def initialize(api: nil, **args)
  @api = api || API.new(**args)
end

Public Instance Methods

bootstrap() click to toggle source
# File lib/unifi_protect/client.rb, line 11
def bootstrap
  @bootstrap ||= api.bootstrap
end
cameras() click to toggle source
# File lib/unifi_protect/client.rb, line 23
def cameras
  @cameras ||= CameraCollection.new(create_camera_objects)
end
create_camera_objects() click to toggle source
# File lib/unifi_protect/client.rb, line 19
def create_camera_objects
  bootstrap.cameras.map { |camera| Camera.new(client: self, camera: camera) }
end
nvr() click to toggle source
# File lib/unifi_protect/client.rb, line 15
def nvr
  @nvr ||= NVR.new(client: self, nvr: bootstrap.nvr)
end