Class: Parameters
Overview
an object of this class represents the parameters
... set from somewhere.
__________________
Currently unused
Constant Summary collapse
- @@config =
Configuration.instance
- @@log =
init_logger(@@config.log_target, @@config.log_level)
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #[] ⇒ Object
- #each(&b) ⇒ Object
- #include?(v) ⇒ Boolean
-
#initialize(parameter_list) ⇒ Parameters
constructor
A new instance of Parameters.
Methods included from Logging
init_logger, log_level=, log_target=
Constructor Details
#initialize(parameter_list) ⇒ Parameters
Returns a new instance of Parameters.
37 38 39 40 41 42 43 44 45 |
# File 'lib/parameters.rb', line 37 def initialize(parameter_list) @log = @@log log_target = @@config.log_target log_level = @@config.log_level @params = parameter_list.split(',').collect {|p| p.strip} @params.each {|p| @@config.set(p.to_sym, true) } @log.debug('config is now: ' << @@config.inspect) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
59 60 61 |
# File 'lib/parameters.rb', line 59 def params @params end |
Instance Method Details
#[] ⇒ Object
55 56 57 |
# File 'lib/parameters.rb', line 55 def [] @params.[] end |
#each(&b) ⇒ Object
47 48 49 |
# File 'lib/parameters.rb', line 47 def each(&b) @params.each {|p| yield(p) } end |
#include?(v) ⇒ Boolean
51 52 53 |
# File 'lib/parameters.rb', line 51 def include?(v) @params.include?(v) end |