class NvimConf::Writers::Code::CommandsWriter

Constants

COMMANDS_GENERATOR_MAPPING

Public Class Methods

new(manager, io, format: :lua, commented: false) click to toggle source
# File lib/nvim_conf/writers/code/commands.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/commands.rb, line 17
def write
  @manager.commands.each do |command|
    @io.write(
      [
        generator_class.new(command).generate,
        "\n"
      ].join
    )
  end
end

Private Instance Methods

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