class NvimConf::Writers::Code::GlobalsWriter

Constants

GLOBAL_GENERATOR_MAPPING

Public Class Methods

new(manager, io, format: :lua, commented: false) click to toggle source
# 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

Public Instance Methods

write() click to toggle source
# 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

Private Instance Methods

generator_class() click to toggle source
# File lib/nvim_conf/writers/code/globals.rb, line 30
def generator_class
  GLOBAL_GENERATOR_MAPPING[@format]
end