Class: NvimConf::Writers::Code::CommandsWriter

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

Constant Summary collapse

COMMANDS_GENERATOR_MAPPING =
{
  lua: Generators::Commands::Code::Lua
}

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CommandsWriter.



11
12
13
14
15
# 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

Instance Method Details

#writeObject



17
18
19
20
21
22
23
24
25
26
# 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