I would like to refactor this code:
class Logger
class << self
def info title, msg
puts hash_for(title, msg, :info ).to_json
end
def unknown title, msg
puts hash_for(title, msg, :unknown).to_json
end
Into something like:
def print title, msg, level
puts hash_for(title, msg, level).to_json
end
alias :info, :print
alias :unknown, :print
But I need to inject the argument, which alias and alias_method do not appear to support.
Ruby 2.3