Class: NvimConf::Managers::Settings

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#settingsObject (readonly)

Returns the value of attribute settings.



6
7
8
# File 'lib/nvim_conf/managers/settings.rb', line 6

def settings
  @settings
end

#titleObject (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_nameObject



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

Returns:

  • (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