Class: IRB::Kit::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/irb/kit/loader.rb

Overview

Loads IRB extensions for namespace.

Constant Summary collapse

ALL =
[:all].freeze

Instance Method Summary collapse

Constructor Details

#initialize(registrar, namespace, all: ALL) ⇒ Loader

Returns a new instance of Loader.



9
10
11
12
13
# File 'lib/irb/kit/loader.rb', line 9

def initialize registrar, namespace, all: ALL
  @registrar = registrar
  @namespace = IRB::Kit.const_get namespace
  @all = all
end

Instance Method Details

#call(*monikers) ⇒ Object



15
# File 'lib/irb/kit/loader.rb', line 15

def call(*monikers) = monikers == all ? register_all : register_selected(*monikers)