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.



12
13
14
15
16
# File 'lib/rbs/cli.rb', line 12

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

Instance Attribute Details

#dirsObject (readonly)

Returns the value of attribute dirs.



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

def dirs
  @dirs
end

#libsObject (readonly)

Returns the value of attribute libs.



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

def libs
  @libs
end

#no_stdlibObject

Returns the value of attribute no_stdlib.



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

def no_stdlib
  @no_stdlib
end

Instance Method Details

#setup(loader) ⇒ Object



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

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