[ create a new paste ] login | about

Link: http://codepad.org/FjSFZHlN    [ raw code | fork ]

Ruby, pasted on May 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Document
  # Most of the class omitted...
  def add_authors( *names )
    @author += " #{names.join(' ')}"
  end
end

doc = Document.new
doc.add_authors('author1', 'author2')


Error msg
`add_authors': undefined method `+' for nil:NilClass (NoMethodError)
	from test.rb:9:in `<main>'


Create a new paste based on this one


Comments: