Class: NvimConf::Managers::Settings
- Inherits:
-
Object
- Object
- NvimConf::Managers::Settings
- Defined in:
- lib/nvim_conf/managers/settings.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #add(key, value, **params) ⇒ Object
-
#initialize(title) ⇒ Settings
constructor
A new instance of Settings.
- #set(key, value = nil, **params) ⇒ Object
- #store? ⇒ Boolean
- #unset(key) ⇒ Object
Constructor Details
#initialize(title) ⇒ Settings
Returns a new instance of Settings.
8 9 10 11 |
# File 'lib/nvim_conf/managers/settings.rb', line 8 def initialize(title) @title = title @settings = [] end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
6 7 8 |
# File 'lib/nvim_conf/managers/settings.rb', line 6 def settings @settings end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/nvim_conf/managers/settings.rb', line 6 def title @title end |
Class Method Details
.section_name ⇒ Object
18 19 20 |
# File 'lib/nvim_conf/managers/settings.rb', line 18 def section_name "Settings" end |
Instance Method Details
#add(key, value, **params) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/nvim_conf/managers/settings.rb', line 39 def add(key, value, **params) store_setting( :add, key: key, value: value, **params ) end |
#set(key, value = nil, **params) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/nvim_conf/managers/settings.rb', line 23 def set(key, value = nil, **params) store_setting( :set, key: key, value: value, **params ) end |
#store? ⇒ Boolean
13 14 15 |
# File 'lib/nvim_conf/managers/settings.rb', line 13 def store? @settings.any? end |
#unset(key) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/nvim_conf/managers/settings.rb', line 32 def unset(key) store_setting( :unset, key: key ) end |