lib/android/devices.rb
# Memoizes the device list on first call
# @return [Hash] Hash with the devices
#
# @note has to be called before calling display_name or manufacturer_name
#   to initialize caches
# TODO: rename this to `initialize` when releasing a major version
Memoizes the device list on first call
Memoizes the device list on first call
def devices
        return @devices unless @devices.nil?
        CSV
          .read(PATH)
          .tap(&method(:load_devices))
          .tap(&method(:load_manufacturers))
        @devices
      end
def devices return @devices unless @devices . nil? CSV . read ( PATH ) . tap ( & method ( :load_devices ) ) . tap ( & method ( :load_manufacturers ) ) @devices end
Memoizes the device list on first call
Memoizes the device list on first call
Hash with the devices
Hash with the devices
Hash
note
has to be called before calling display_name or manufacturer_name to initialize caches TODO: rename this to `initialize` when releasing a major version
has to be called before calling display_name or manufacturer_name to initialize caches TODO : rename this to ` initialize ` when releasing a major version