On Saturday 23 August 2008, Pepe Sanchez wrote:
> When I try to initialize this class
>
> class Ticket
>  def event
>   $event
>  end
> end
>
> ticket = Ticket.new("Can't really be specified yet...")
> puts ticket.event
>
> I get an error message:
> undefined method `event' for nil:NilClass
>
> Why?

Try this:

class Ticket

  attr_reader :event

  def initialize msg
    @event = msg
  end

end

Stefano