class Hackasm::Commands::Asm2Binary
Constants
- FILE_NAME
Public Class Methods
new(file, options)
click to toggle source
# File lib/hackasm/commands/asm2binary.rb, line 11 def initialize(file, options) @file = file @options = options end
Public Instance Methods
execute(input: $stdin, output: $stdout)
click to toggle source
# File lib/hackasm/commands/asm2binary.rb, line 16 def execute(input: $stdin, output: $stdout) assembler_code = File.read(@file) binary = Assembler::Translator.new(assembler_code).translate output.puts binary File.write(FILE_NAME, binary) end