Class: Redmine::Installer::ConfigParams
- Inherits:
-
Object
- Object
- Redmine::Installer::ConfigParams
- Defined in:
- lib/redmine-installer/config_param.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #add(name) ⇒ Object
- #each(&block) ⇒ Object
- #for_asking ⇒ Object
-
#initialize ⇒ ConfigParams
constructor
A new instance of ConfigParams.
- #map(&block) ⇒ Object
Constructor Details
#initialize ⇒ ConfigParams
Returns a new instance of ConfigParams.
12 13 14 |
# File 'lib/redmine-installer/config_param.rb', line 12 def initialize @params = [] end |
Instance Method Details
#[](key) ⇒ Object
16 17 18 |
# File 'lib/redmine-installer/config_param.rb', line 16 def [](key) @params.detect{|p| p.name == key} end |
#add(name) ⇒ Object
24 25 26 27 28 |
# File 'lib/redmine-installer/config_param.rb', line 24 def add(name) param = ConfigParam.new(name) @params << param param end |
#each(&block) ⇒ Object
30 31 32 |
# File 'lib/redmine-installer/config_param.rb', line 30 def each(&block) @params.each(&block) end |
#for_asking ⇒ Object
20 21 22 |
# File 'lib/redmine-installer/config_param.rb', line 20 def for_asking @for_asking ||= @params.select{|p| p.ask} end |
#map(&block) ⇒ Object
34 35 36 |
# File 'lib/redmine-installer/config_param.rb', line 34 def map(&block) @params.map(&block) end |