Class: TRuby::Config

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

Constant Summary collapse

DEFAULT_CONFIG =
{
  "emit" => {
    "rb" => true,
    "rbs" => false,
    "dtrb" => false
  },
  "paths" => {
    "src" => "./src",
    "out" => "./build"
  },
  "strict" => {
    "rbs_compat" => true,
    "null_safety" => false,
    "inference" => "basic"
  }
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_path = nil) ⇒ Config

Returns a new instance of Config.



26
27
28
29
30
31
# File 'lib/t_ruby/config.rb', line 26

def initialize(config_path = nil)
  config = load_config(config_path)
  @emit = config["emit"]
  @paths = config["paths"]
  @strict = config["strict"]
end

Instance Attribute Details

#emitObject (readonly)

Returns the value of attribute emit.



24
25
26
# File 'lib/t_ruby/config.rb', line 24

def emit
  @emit
end

#pathsObject (readonly)

Returns the value of attribute paths.



24
25
26
# File 'lib/t_ruby/config.rb', line 24

def paths
  @paths
end

#strictObject (readonly)

Returns the value of attribute strict.



24
25
26
# File 'lib/t_ruby/config.rb', line 24

def strict
  @strict
end

Instance Method Details

#out_dirObject



33
34
35
# File 'lib/t_ruby/config.rb', line 33

def out_dir
  @paths["out"]
end

#src_dirObject



37
38
39
# File 'lib/t_ruby/config.rb', line 37

def src_dir
  @paths["src"]
end