Class: Extracare2of::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/ExtraCare2OF/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

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

#debugObject (readonly)

Returns the value of attribute debug.



3
4
5
# File 'lib/ExtraCare2OF/settings.rb', line 3

def debug
  @debug
end

#use_dueappObject (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_omnifocusObject (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_remindersObject (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_thingsObject (readonly)

Returns the value of attribute use_things.



3
4
5
# File 'lib/ExtraCare2OF/settings.rb', line 3

def use_things
  @use_things
end