Class: Rdm::Source
- Inherits:
-
Object
- Object
- Rdm::Source
- Defined in:
- lib/rdm/source.rb
Instance Attribute Summary collapse
-
#config_names ⇒ Object
readonly
Returns the value of attribute config_names.
-
#package_paths ⇒ Object
readonly
Returns the value of attribute package_paths.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
-
#setup_block ⇒ Object
readonly
Returns the value of attribute setup_block.
Instance Method Summary collapse
-
#config(config_name) ⇒ Object
Add config to list of known configs.
-
#configs ⇒ Hash<String: Rdm::Config>
Read initialized configs.
-
#init_with(packages:, configs:) ⇒ Hash<String: Rdm::Package>
Init source by adding read packages and configs.
-
#initialize(root_path:) ⇒ Source
constructor
A new instance of Source.
-
#package(package_path) ⇒ Object
Add package to list of known packages.
-
#packages ⇒ Hash<String: Rdm::Package>
Read initialized packages.
-
#setup(&block) ⇒ Object
Set setup block for source.
Constructor Details
#initialize(root_path:) ⇒ Source
Returns a new instance of Source.
4 5 6 7 8 |
# File 'lib/rdm/source.rb', line 4 def initialize(root_path:) @root_path = root_path @config_names = [] @package_paths = [] end |
Instance Attribute Details
#config_names ⇒ Object (readonly)
Returns the value of attribute config_names.
2 3 4 |
# File 'lib/rdm/source.rb', line 2 def config_names @config_names end |
#package_paths ⇒ Object (readonly)
Returns the value of attribute package_paths.
2 3 4 |
# File 'lib/rdm/source.rb', line 2 def package_paths @package_paths end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
2 3 4 |
# File 'lib/rdm/source.rb', line 2 def root_path @root_path end |
#setup_block ⇒ Object (readonly)
Returns the value of attribute setup_block.
2 3 4 |
# File 'lib/rdm/source.rb', line 2 def setup_block @setup_block end |
Instance Method Details
#config(config_name) ⇒ Object
Add config to list of known configs
18 19 20 |
# File 'lib/rdm/source.rb', line 18 def config(config_name) @config_names << config_name.to_s end |
#configs ⇒ Hash<String: Rdm::Config>
Read initialized configs
45 46 47 |
# File 'lib/rdm/source.rb', line 45 def configs @configs || {} end |
#init_with(packages:, configs:) ⇒ Hash<String: Rdm::Package>
Init source by adding read packages and configs
32 33 34 35 |
# File 'lib/rdm/source.rb', line 32 def init_with(packages:, configs:) @packages = packages @configs = configs end |
#package(package_path) ⇒ Object
Add package to list of known packages
24 25 26 |
# File 'lib/rdm/source.rb', line 24 def package(package_path) @package_paths << package_path end |
#packages ⇒ Hash<String: Rdm::Package>
Read initialized packages
39 40 41 |
# File 'lib/rdm/source.rb', line 39 def packages @packages || {} end |
#setup(&block) ⇒ Object
Set setup block for source
12 13 14 |
# File 'lib/rdm/source.rb', line 12 def setup(&block) @setup_block = block end |