Class: Gio::Settings
- Inherits:
-
Object
- Object
- Gio::Settings
- Defined in:
- lib/gio2/settings.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Settings
constructor
A new instance of Settings.
- #initialize_raw ⇒ Object
- #set_value(key, value) ⇒ Object (also: #[]=)
- #set_value_raw ⇒ Object
Constructor Details
permalink #initialize(*args) ⇒ Settings
Returns a new instance of Settings.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/gio2/settings.rb', line 21 def initialize(*args) if args.size == 1 initialize_raw(args[0]) elsif args.size == 2 schema_id = args[0] = args[1] path = [:path] || nil backend = [:backend] || nil if path && backend initialize_new_with_backend_and_path(schema_id, backend, path) elsif path initialize_new_with_path(schema_id, path) elsif backend initialize_new_with_backend(schema_id, backend) end elsif args.size == 3 initialize_new_full(*args) else $stderr.puts "Arguments error for Gio::Settings#new" end end |
Instance Method Details
permalink #initialize_raw ⇒ Object
[View source]
19 |
# File 'lib/gio2/settings.rb', line 19 alias_method :initialize_raw, :initialize |
permalink #set_value(key, value) ⇒ Object Also known as: []=
[View source]
44 45 46 47 48 |
# File 'lib/gio2/settings.rb', line 44 def set_value(key, value) schema_key = settings_schema.get_key(key) variant_value = GLib::Variant.new(value, schema_key.value_type) set_value_raw(key, variant_value) end |
permalink #set_value_raw ⇒ Object
[View source]
43 |
# File 'lib/gio2/settings.rb', line 43 alias_method :set_value_raw, :set_value |