Class: Extracare2of::Settings
- Inherits:
-
Object
- Object
- Extracare2of::Settings
- Defined in:
- lib/ExtraCare2OF/settings.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#use_dueapp ⇒ Object
readonly
Returns the value of attribute use_dueapp.
-
#use_omnifocus ⇒ Object
readonly
Returns the value of attribute use_omnifocus.
-
#use_reminders ⇒ Object
readonly
Returns the value of attribute use_reminders.
-
#use_things ⇒ Object
readonly
Returns the value of attribute use_things.
Instance Method Summary collapse
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ExtraCare2OF/settings.rb', line 5 def initialize @filename = "#{ENV['HOME']}/.extracare2of/config/config.yml" unless File.exists?(@filename) config = {services: { :use_omnifocus => true, :use_reminders => false, :use_things => false, :use_dueapp => false } } File.open(@filename, "w") do |f| f.write(config.to_yaml) end end @settings = YAML.load_file(@filename) @use_omnifocus = @settings[:services][:use_omnifocus] @use_reminders = @settings[:services][:use_reminders] @use_things = @settings[:services][:use_things] @use_dueapp = @settings[:services][:use_dueapp] end |
Instance Attribute Details
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
3 4 5 |
# File 'lib/ExtraCare2OF/settings.rb', line 3 def debug @debug end |
#use_dueapp ⇒ Object (readonly)
Returns the value of attribute use_dueapp.
3 4 5 |
# File 'lib/ExtraCare2OF/settings.rb', line 3 def use_dueapp @use_dueapp end |
#use_omnifocus ⇒ Object (readonly)
Returns the value of attribute use_omnifocus.
3 4 5 |
# File 'lib/ExtraCare2OF/settings.rb', line 3 def use_omnifocus @use_omnifocus end |
#use_reminders ⇒ Object (readonly)
Returns the value of attribute use_reminders.
3 4 5 |
# File 'lib/ExtraCare2OF/settings.rb', line 3 def use_reminders @use_reminders end |
#use_things ⇒ Object (readonly)
Returns the value of attribute use_things.
3 4 5 |
# File 'lib/ExtraCare2OF/settings.rb', line 3 def use_things @use_things end |