Class: MultiRepo::RepoSelection
- Inherits:
-
Object
- Object
- MultiRepo::RepoSelection
- Defined in:
- lib/multirepo/logic/repo-selection.rb
Constant Summary collapse
- ALL =
0- MAIN =
1- DEPS =
2
Instance Method Summary collapse
-
#initialize(argv) ⇒ RepoSelection
constructor
A new instance of RepoSelection.
- #valid? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(argv) ⇒ RepoSelection
Returns a new instance of RepoSelection.
9 10 11 12 13 |
# File 'lib/multirepo/logic/repo-selection.rb', line 9 def initialize(argv) @main = argv.flag?("main") @deps = argv.flag?("deps") @all = argv.flag?("all") end |
Instance Method Details
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/multirepo/logic/repo-selection.rb', line 15 def valid? Utils.only_one_true?(@main, @deps, @all) end |
#value ⇒ Object
19 20 21 22 23 |
# File 'lib/multirepo/logic/repo-selection.rb', line 19 def value return MAIN if @main return DEPS if @deps return ALL # Default if unspecified end |