Class: TRuby::Config
- Inherits:
-
Object
- Object
- TRuby::Config
- 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
-
#emit ⇒ Object
readonly
Returns the value of attribute emit.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#strict ⇒ Object
readonly
Returns the value of attribute strict.
Instance Method Summary collapse
-
#initialize(config_path = nil) ⇒ Config
constructor
A new instance of Config.
- #out_dir ⇒ Object
- #src_dir ⇒ Object
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
#emit ⇒ Object (readonly)
Returns the value of attribute emit.
24 25 26 |
# File 'lib/t_ruby/config.rb', line 24 def emit @emit end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
24 25 26 |
# File 'lib/t_ruby/config.rb', line 24 def paths @paths end |
#strict ⇒ Object (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_dir ⇒ Object
33 34 35 |
# File 'lib/t_ruby/config.rb', line 33 def out_dir @paths["out"] end |
#src_dir ⇒ Object
37 38 39 |
# File 'lib/t_ruby/config.rb', line 37 def src_dir @paths["src"] end |