Class: Hbc::CaskLoader::NullLoader

Inherits:
FromPathLoader show all
Defined in:
Library/Homebrew/cask/lib/hbc/cask_loader.rb

Instance Attribute Summary

Attributes inherited from FromPathLoader

#path, #token

Attributes inherited from FromContentLoader

#content

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref) ⇒ NullLoader

Returns a new instance of NullLoader



153
154
155
156
# File 'Library/Homebrew/cask/lib/hbc/cask_loader.rb', line 153

def initialize(ref)
  token = File.basename(ref, ".rb")
  super CaskLoader.default_path(token)
end

Class Method Details

.can_load?Boolean

Returns:

  • (Boolean)


149
150
151
# File 'Library/Homebrew/cask/lib/hbc/cask_loader.rb', line 149

def self.can_load?(*)
  true
end

Instance Method Details

#loadObject



158
159
160
# File 'Library/Homebrew/cask/lib/hbc/cask_loader.rb', line 158

def load
  raise CaskUnavailableError.new(token, "No Cask with this name exists.")
end