Created
May 12, 2009 16:19
-
-
Save lucashungaro/110567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> shelf = MovieShelf.new | |
=> #<MovieShelf:0x36eb88 @movies=[]> | |
>> m = Movie.new | |
=> #<Movie:0x33b328> | |
>> m.title = "Juno" | |
=> "Juno" | |
>> m2 = Movie.new | |
=> #<Movie:0x39968> | |
>> m2.title = "Transformers" | |
=> "Transformers" | |
>> shelf.movies << m | |
=> [#<Movie:0x33b328 @title="Juno">] | |
>> shelf.movies << m2 | |
=> [#<Movie:0x33b328 @title="Juno">, #<Movie:0x39968 @title="Transformers">] | |
>> shelf.list | |
Juno | |
Transformers | |
=> [#<Movie:0x33b328 @title="Juno">, #<Movie:0x39968 @title="Transformers">] | |
>> shelf.lookup m2 | |
=> #<Movie:0x39968 @title="Transformers"> | |
>> shelf.movies.delete m2 | |
=> #<Movie:0x39968 @title="Transformers"> | |
>> shelf.list | |
Juno | |
=> [#<Movie:0x33b328 @title="Juno">] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment