Class: RBS::Dynamic::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Config

Returns a new instance of Config.



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

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/rbs/dynamic/config.rb', line 5

def options
  @options
end

Instance Method Details

#except_build_membersObject



11
12
13
# File 'lib/rbs/dynamic/config.rb', line 11

def except_build_members
  ignore_class_members
end

#ignore_class_membersObject



35
36
37
# File 'lib/rbs/dynamic/config.rb', line 35

def ignore_class_members
  (options["ignore-class_members"] || options[:ignore_class_members] || []).map(&:to_sym)
end

#ignore_classname_patternObject



31
32
33
# File 'lib/rbs/dynamic/config.rb', line 31

def ignore_classname_pattern
  (options["ignore-classname-pattern"] || options[:ignore_classname_pattern])&.then { Regexp.new(_1) }
end

#ignore_filepath_patternObject



23
24
25
# File 'lib/rbs/dynamic/config.rb', line 23

def ignore_filepath_pattern
  options["ignore-filepath-pattern"] || options[:ignore_filepath_pattern]
end

#method_defined_calsssesObject



39
40
41
# File 'lib/rbs/dynamic/config.rb', line 39

def method_defined_calssses
  (options["method-defined-calsses"] || options[:method_defined_calssses] || %i(defined_class receiver_class)).map(&:to_sym)
end

#root_pathObject



15
16
17
# File 'lib/rbs/dynamic/config.rb', line 15

def root_path
  options["root-path"] || options[:root_path] || Dir.pwd
end

#show_method_location?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/rbs/dynamic/config.rb', line 43

def show_method_location?
  options["show-method-location"] || options[:show_method_location] || false
end

#stdout?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/rbs/dynamic/config.rb', line 63

def stdout?
  (options["stdout"] || options[:stdout]).then { _1.nil? ? true : _1 }
end

#target_classname_patternObject



27
28
29
# File 'lib/rbs/dynamic/config.rb', line 27

def target_classname_pattern
  Regexp.new(options["target-classname-pattern"] || options[:target_classname_pattern] || /.*/)
end

#target_filepath_patternObject



19
20
21
# File 'lib/rbs/dynamic/config.rb', line 19

def target_filepath_pattern
  options["target-filepath-pattern"] || options[:target_filepath_pattern] || /.*/
end

#trace_c_api_method?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/rbs/dynamic/config.rb', line 59

def trace_c_api_method?
  options["trace-c_api-method"] || options[:trace_c_api_method] || false
end

#use_interface_method_argument?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/rbs/dynamic/config.rb', line 55

def use_interface_method_argument?
  options["use-interface_method_argument"] || options[:use_interface_method_argument] || false
end

#use_literal_type?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/rbs/dynamic/config.rb', line 47

def use_literal_type?
  options["use-literal_type"] || options[:use_literal_type] || false
end

#with_literal_type?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/rbs/dynamic/config.rb', line 51

def with_literal_type?
  options["with-literal_type"] || options[:with_literal_type] || false
end