Class: SysPref::JavaStore
- Inherits:
-
Object
- Object
- SysPref::JavaStore
- Defined in:
- lib/iated/sys_pref.rb
Overview
Wrapper around Java’s ‘java.util.prefs.Preferences`
Instance Method Summary collapse
- #get(key, default) ⇒ String
- #getInt(key, default) ⇒ Integer
-
#initialize ⇒ JavaStore
constructor
A new instance of JavaStore.
- #put(key, value) ⇒ nil
- #putInt(key, value) ⇒ nil
Constructor Details
#initialize ⇒ JavaStore
Returns a new instance of JavaStore.
22 23 24 25 |
# File 'lib/iated/sys_pref.rb', line 22 def initialize super @store = java.util.prefs.Preferences.userNodeForPackage(self.getClass) end |
Instance Method Details
#get(key, default) ⇒ String
35 36 37 |
# File 'lib/iated/sys_pref.rb', line 35 def get key, default @store.get key.to_s, default.to_s end |
#getInt(key, default) ⇒ Integer
27 28 29 |
# File 'lib/iated/sys_pref.rb', line 27 def getInt key, default @store.getInt key.to_s, default.to_i end |
#put(key, value) ⇒ nil
39 40 41 |
# File 'lib/iated/sys_pref.rb', line 39 def put key, value @store.put key.to_s, value.to_s end |
#putInt(key, value) ⇒ nil
31 32 33 |
# File 'lib/iated/sys_pref.rb', line 31 def putInt key, value @store.putInt key.to_s, value.to_i end |