Module: Trello::TrelloConfig
- Included in:
- Api::Integration, Api::Trello, Main
- Defined in:
- lib/trello/trello_config.rb
Instance Method Summary collapse
- #__config_dir__ ⇒ Object
- #config ⇒ Object
- #param_check(field, message) ⇒ Object
- #save_config ⇒ Object
Instance Method Details
#__config_dir__ ⇒ Object
19 20 21 |
# File 'lib/trello/trello_config.rb', line 19 def __config_dir__ @config_dir end |
#config ⇒ Object
3 4 5 |
# File 'lib/trello/trello_config.rb', line 3 def config @config ||= load_config end |
#param_check(field, message) ⇒ Object
13 14 15 16 17 |
# File 'lib/trello/trello_config.rb', line 13 def param_check(field, ) unless config[field] abort end end |
#save_config ⇒ Object
7 8 9 10 11 |
# File 'lib/trello/trello_config.rb', line 7 def save_config # need to fetch the config first to make sure its directory is properly defined current_config = config File.open("#{@config_dir}/#{CONFIG_FILE_NAME}" || CONFIG_FILE_NAME, 'w') {|f| f.write current_config.to_hash.to_yaml } end |