From: Christoph Schiessl Date: 2008-05-17T01:54:36+09:00 Subject: Ruby classes and << Syntax I have written a simple snippet of code and would appreciate any help with understanding what's really going on. ### Creating Basic Class class Person # Same as: class Person < Object attr_accessor :firstname attr_accessor :lastname def initialize(firstname, lastname) @firstname, @lastname = firstname, lastname end def fullname @firstname + ' ' + @lastname end end ### Create two instances of class Person john = Person.new('John', 'Doe') john.firstname # => "John" john.lastname # => "Doe" john.to_s # => "#" jack = Person.new('Jack', 'Stone') jack.firstname # => "Jack" jack.lastname # => "Stone" jack.to_s # => "#" class Person def to_s 'Person: ' + fullname end end john.to_s # => "Person: John Doe" jack.to_s # => "Person: Jack Stone" ### Everything as expected until here... ### Now the interesing part: class < NoMethodError: undefined method `birthday' for # jack.birthday # => NoMethodError: undefined method `birthday' for # frank = Person.new('Frank', 'New') # => Try with new instance frank.birthday # => NoMethodError: undefined method `birthday' for # ### So basically my question is: What does the 'class <