Class: LicenseAcceptance::Config
- Inherits:
-
Object
- Object
- LicenseAcceptance::Config
- Defined in:
- lib/license_acceptance/config.rb
Instance Attribute Summary collapse
-
#license_locations ⇒ Object
Returns the value of attribute license_locations.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#output ⇒ Object
Returns the value of attribute output.
-
#persist ⇒ Object
Returns the value of attribute persist.
-
#persist_location ⇒ Object
Returns the value of attribute persist_location.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(opts = {}) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 14 |
# File 'lib/license_acceptance/config.rb', line 7 def initialize(opts={}) @output = opts.fetch(:output, $stdout) @logger = opts.fetch(:logger, ::Logger.new(IO::NULL)) @license_locations = opts.fetch(:license_locations, default_license_locations) @license_locations = [ @license_locations ].flatten @persist_location = opts.fetch(:persist_location, default_persist_location) @persist = opts.fetch(:persist, true) end |
Instance Attribute Details
#license_locations ⇒ Object
Returns the value of attribute license_locations.
5 6 7 |
# File 'lib/license_acceptance/config.rb', line 5 def license_locations @license_locations end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/license_acceptance/config.rb', line 5 def logger @logger end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/license_acceptance/config.rb', line 5 def output @output end |
#persist ⇒ Object
Returns the value of attribute persist.
5 6 7 |
# File 'lib/license_acceptance/config.rb', line 5 def persist @persist end |
#persist_location ⇒ Object
Returns the value of attribute persist_location.
5 6 7 |
# File 'lib/license_acceptance/config.rb', line 5 def persist_location @persist_location end |