Module: JSI::Util::Private::Virtual Private

Defined in:
lib/jsi/util/private.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: InstantiationError

Instance Method Summary collapse

Instance Method Details

#initializeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

this virtual class is not intended to be instantiated except by its subclasses, which override #initialize

Raises:



188
189
190
191
192
# File 'lib/jsi/util/private.rb', line 188

def initialize
  # :nocov:
  raise(InstantiationError, "cannot instantiate virtual class #{self.class}")
  # :nocov:
end

#virtual_methodObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

virtual_method is used to indicate that the method calling it must be implemented on the (non-virtual) subclass

Raises:



195
196
197
198
199
# File 'lib/jsi/util/private.rb', line 195

def virtual_method
  # :nocov:
  raise(Bug, "class #{self.class} must implement #{caller_locations.first.label}")
  # :nocov:
end