Class: NvimConf::Writers::Code::GlobalsWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/nvim_conf/writers/code/globals.rb

Constant Summary collapse

GLOBAL_GENERATOR_MAPPING =
{
  lua: Generators::Globals::Code::Lua
}

Instance Method Summary collapse

Constructor Details

#initialize(manager, io, format: :lua, commented: false) ⇒ GlobalsWriter

Returns a new instance of GlobalsWriter.



11
12
13
14
15
# File 'lib/nvim_conf/writers/code/globals.rb', line 11

def initialize(manager, io, format: :lua, commented: false)
  @manager = manager
  @io = io
  @format = format
end

Instance Method Details

#writeObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/nvim_conf/writers/code/globals.rb', line 17

def write
  @manager.globals.each do |global|
    @io.write(
      [
        generator_class.new(global).generate,
        "\n"
      ].join
    )
  end
end