Class: Mnemosyne::Registry::Registration

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/mnemosyne/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(class_name, require_paths, probe) ⇒ Registration

Returns a new instance of Registration.



12
13
14
15
16
# File 'lib/mnemosyne/registry.rb', line 12

def initialize(class_name, require_paths, probe)
  @class_name = class_name
  @require_paths = Array(require_paths)
  @probe = probe
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



10
11
12
# File 'lib/mnemosyne/registry.rb', line 10

def class_name
  @class_name
end

#require_pathsObject (readonly)

Returns the value of attribute require_paths.



10
11
12
# File 'lib/mnemosyne/registry.rb', line 10

def require_paths
  @require_paths
end

Instance Method Details

#installable?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
# File 'lib/mnemosyne/registry.rb', line 18

def installable?
  return true unless class_name

  Module.const_defined?(class_name)
end