T
Tron Fu
The following code works in Ruby 1.8.7 but not in 1.9.2, instead, I get
the error:
NoMethodError: undefined method `old_encode64' for Base64:Module
Can someone please shed some light on this.
Thanks in advance,
Tron
module Base64
alias ld_encode64 :encode64
module_function # this seems to be necessary -- get a "wrong number of
arguments (2 for 1)" without it this line.
def encode64(bin,options={})
if (options[:no_line_break] == true)
old_encode64(bin).gsub(/\n/, '')
else
old_encode64(bin)
end
end
end
the error:
NoMethodError: undefined method `old_encode64' for Base64:Module
Can someone please shed some light on this.
Thanks in advance,
Tron
module Base64
alias ld_encode64 :encode64
module_function # this seems to be necessary -- get a "wrong number of
arguments (2 for 1)" without it this line.
def encode64(bin,options={})
if (options[:no_line_break] == true)
old_encode64(bin).gsub(/\n/, '')
else
old_encode64(bin)
end
end
end