Class: Kleiber::Settings
- Inherits:
-
Object
- Object
- Kleiber::Settings
- Defined in:
- lib/kleiber/settings.rb
Overview
Provides access to settings of library
Constant Summary collapse
- REQUIRED_KEYS =
backporting for old ruby versions
%w(name prefix path guest_port host_port host).map(&:to_sym)
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ Settings
constructor
A new instance of Settings.
-
#projects ⇒ Array
Returns projects settings hash.
-
#symphonies ⇒ Hash
Returns symphonies settings.
-
#tasks ⇒ Hash
Returns tasks settings hash.
-
#terminal ⇒ Hash
Returns terminal settings.
-
#valid? ⇒ Boolean
Validates settings.
Constructor Details
#initialize(path) ⇒ Settings
Returns a new instance of Settings.
15 16 17 |
# File 'lib/kleiber/settings.rb', line 15 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
13 14 15 |
# File 'lib/kleiber/settings.rb', line 13 def path @path end |
Instance Method Details
#projects ⇒ Array
Returns projects settings hash
21 22 23 |
# File 'lib/kleiber/settings.rb', line 21 def projects config[:projects] end |
#symphonies ⇒ Hash
Returns symphonies settings
39 40 41 |
# File 'lib/kleiber/settings.rb', line 39 def symphonies config[:symphonies] end |
#tasks ⇒ Hash
Returns tasks settings hash
27 28 29 |
# File 'lib/kleiber/settings.rb', line 27 def tasks config[:tasks] end |
#terminal ⇒ Hash
Returns terminal settings
33 34 35 |
# File 'lib/kleiber/settings.rb', line 33 def terminal config[:terminal] end |
#valid? ⇒ Boolean
Validates settings
45 46 47 48 49 |
# File 'lib/kleiber/settings.rb', line 45 def valid? private_methods.map do |m| send(m) if m.to_s.start_with?('validate_') end.compact.all? end |