Class: EmbeddedJs::Config
- Inherits:
-
Object
- Object
- EmbeddedJs::Config
- Defined in:
- lib/embedded_js/config.rb
Constant Summary collapse
- DEFAULT_CONFIG_PATH =
'./.embeddedjs'
Instance Attribute Summary collapse
-
#gems ⇒ Object
Returns the value of attribute gems.
-
#package_manager ⇒ Object
Returns the value of attribute package_manager.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(package_manager: :npm, gems: []) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(package_manager: :npm, gems: []) ⇒ Config
Returns a new instance of Config.
17 18 19 20 |
# File 'lib/embedded_js/config.rb', line 17 def initialize(package_manager: :npm, gems: []) @gems = gems @package_manager = package_manager.to_sym end |
Instance Attribute Details
#gems ⇒ Object
Returns the value of attribute gems.
15 16 17 |
# File 'lib/embedded_js/config.rb', line 15 def gems @gems end |
#package_manager ⇒ Object
Returns the value of attribute package_manager.
15 16 17 |
# File 'lib/embedded_js/config.rb', line 15 def package_manager @package_manager end |
Class Method Details
.load(config_path: DEFAULT_CONFIG_PATH) ⇒ Object
10 11 12 |
# File 'lib/embedded_js/config.rb', line 10 def load(config_path: DEFAULT_CONFIG_PATH) new(**JSON.parse(File.read(config_path), symbolize_names: true)) end |