Class: Muon::Config
- Inherits:
-
Object
- Object
- Muon::Config
- Defined in:
- lib/muon/config.rb
Instance Attribute Summary collapse
-
#global_file ⇒ Object
readonly
Returns the value of attribute global_file.
-
#local_file ⇒ Object
readonly
Returns the value of attribute local_file.
Instance Method Summary collapse
- #get_global_option(key) ⇒ Object
- #get_local_option(key) ⇒ Object
- #get_option(key) ⇒ Object
-
#initialize(local_file, global_file) ⇒ Config
constructor
A new instance of Config.
- #set_global_option(key, value) ⇒ Object
- #set_local_option(key, value) ⇒ Object (also: #set_option)
Constructor Details
#initialize(local_file, global_file) ⇒ Config
Returns a new instance of Config.
7 8 9 |
# File 'lib/muon/config.rb', line 7 def initialize(local_file, global_file) @local_file, @global_file = local_file, global_file end |
Instance Attribute Details
#global_file ⇒ Object (readonly)
Returns the value of attribute global_file.
5 6 7 |
# File 'lib/muon/config.rb', line 5 def global_file @global_file end |
#local_file ⇒ Object (readonly)
Returns the value of attribute local_file.
5 6 7 |
# File 'lib/muon/config.rb', line 5 def local_file @local_file end |
Instance Method Details
#get_global_option(key) ⇒ Object
25 26 27 |
# File 'lib/muon/config.rb', line 25 def get_global_option(key) get_option_from_file(global_file, key) end |
#get_local_option(key) ⇒ Object
15 16 17 |
# File 'lib/muon/config.rb', line 15 def get_local_option(key) get_option_from_file(local_file, key) end |
#get_option(key) ⇒ Object
11 12 13 |
# File 'lib/muon/config.rb', line 11 def get_option(key) get_local_option(key) || get_global_option(key) end |
#set_global_option(key, value) ⇒ Object
29 30 31 |
# File 'lib/muon/config.rb', line 29 def set_global_option(key, value) set_option_in_file(global_file, key, value) end |
#set_local_option(key, value) ⇒ Object Also known as: set_option
19 20 21 |
# File 'lib/muon/config.rb', line 19 def set_local_option(key, value) set_option_in_file(local_file, key, value) end |