Class: RBS::CLI::LibraryOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLibraryOptions

Returns a new instance of LibraryOptions.



10
11
12
13
14
# File 'lib/rbs/cli.rb', line 10

def initialize()
  @libs = []
  @dirs = []
  @no_stdlib = false
end

Instance Attribute Details

#dirsObject (readonly)

Returns the value of attribute dirs.



7
8
9
# File 'lib/rbs/cli.rb', line 7

def dirs
  @dirs
end

#libsObject (readonly)

Returns the value of attribute libs.



6
7
8
# File 'lib/rbs/cli.rb', line 6

def libs
  @libs
end

#no_stdlibObject

Returns the value of attribute no_stdlib.



8
9
10
# File 'lib/rbs/cli.rb', line 8

def no_stdlib
  @no_stdlib
end

Instance Method Details

#setup(loader) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rbs/cli.rb', line 16

def setup(loader)
  libs.each do |lib|
    loader.add(library: lib)
  end

  dirs.each do |dir|
    loader.add(path: Pathname(dir))
  end

  loader.no_builtin! if no_stdlib

  loader
end