Class: FlickrSync::Preferences
- Inherits:
-
Object
- Object
- FlickrSync::Preferences
- Defined in:
- lib/flickr_sync/preferences.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Preferences
constructor
A new instance of Preferences.
Constructor Details
#initialize ⇒ Preferences
Returns a new instance of Preferences.
5 6 7 8 9 10 11 12 |
# File 'lib/flickr_sync/preferences.rb', line 5 def initialize @preference_path = home_path '.flickr_sync' if File.exists? @preference_path @preferences = YAML.load File.read(@preference_path) else @preferences = {} end end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/flickr_sync/preferences.rb', line 14 def [] key @preferences[key] end |
#[]=(key, value) ⇒ Object
18 19 20 21 |
# File 'lib/flickr_sync/preferences.rb', line 18 def []= key, value @preferences[key] = value persist end |