class UnifiProtect::NVR

Constants

TIME_FIELDS

Attributes

nvr[R]

Public Class Methods

new(client:, nvr:) click to toggle source
# File lib/unifi_protect/nvr.rb, line 9
def initialize(client:, nvr:)
  @client = client
  @nvr = nvr
end

Public Instance Methods

inspect() click to toggle source
# File lib/unifi_protect/nvr.rb, line 18
def inspect
  to_s
end
method_missing(method_name, *args) click to toggle source
# File lib/unifi_protect/nvr.rb, line 26
def method_missing(method_name, *args)
  value = @nvr.send(method_name, *args)
  return Time.at(value / 1000) if value && TIME_FIELDS.include?(method_name)

  value
end
respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/unifi_protect/nvr.rb, line 22
def respond_to_missing?(method_name, include_private = false)
  @nvr.respond_to?(method_name) || super
end
to_s() click to toggle source
# File lib/unifi_protect/nvr.rb, line 14
def to_s
  "#<#{self.class.name} id=#{@nvr.id.inspect} name=#{@nvr.name.inspect}>"
end