Class: Redmine::Installer::ConfigParams

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine-installer/config_param.rb

Instance Method Summary collapse

Constructor Details

#initializeConfigParams

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_askingObject



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