Hi Guys
Trying to copy your code but not having any luck
All I get is "wrong number of arguments (3 for 0..1)" in the
initialize call back actually referring to the .new call in the raise
Can't see what I'm doing wrong.
Any help greatly appreciated
regards
dukha
module Exceptions
class IncorrectArrayFormatInYamlFile < StandardError
attr_accessible :line_number, :translation_file_id
def initialize( msg, line_number, translation_file_id)
super(msg)
@line_number = line_number
@translation_file_id =translation_file_id
end
def file_name
return
TranslationFile.find(@translation_file_id).english_translation_file_name
end
def message
message = @message + "line number: #{@line_number}, file:
#{file_name}."
end
end
end
msg = "This file is using incorrect array format. Change file format
from \" - <array_element>\" to key: [element1,element2..]. This
element is on line " + line_sequence.to_s + " in " +
TranslationFile.find(translation_file_id).english_translation_file_name
raise Exceptions::IncorrectArrayFormatInYamlFile.new msg,
line_sequence, translation_file_id
On May 23, 10:36 pm, Frederick Cheung <[email protected]>
wrote:
> On May 23, 11:39 am, Erwin <[email protected]> wrote:
>
> > def remote_container_id; @remote_container_id; end
> > def request_id; @request_id; end
> > def user_id; @user_id; end
>
> by the way, if you were to write
>
> attr_reader :remote_container_id, :request_id, :user_id then that
> would write your reader methods for you
>
> Fred
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.