From 0fccea4f0d925486cfaf23c5aadcbab662a70958 Mon Sep 17 00:00:00 2001 From: Messay Bekele Date: Sun, 23 Mar 2014 13:02:29 -0400 Subject: [PATCH 1/3] updating fred... --- fred.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/fred.rb b/fred.rb index 2754fdb..a9ddf2d 100644 --- a/fred.rb +++ b/fred.rb @@ -1,18 +1,7 @@ -# Class names must be capitalized. Technically, it's a constant. class Fred + attr_accessor :occupation - # The initialize method is the constructor. The @val is - # an object value. def initialize(v) - @val = v - end - - # Set it and get it. - def set(v) - @val = v - end - - def get - return @val + @occupation = v end end From 40068919cb449f466212f4490cbbb1abbed38d26 Mon Sep 17 00:00:00 2001 From: walia Date: Sun, 23 Mar 2014 13:06:35 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5cbd17e..af6672f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ sandbox ======= adding a readme +adding more lines. From ce6b5f01baccd587a2a1f132d296bbd19f19331d Mon Sep 17 00:00:00 2001 From: Messay Bekele Date: Sun, 23 Mar 2014 13:13:36 -0400 Subject: [PATCH 3/3] adding age for fred. --- fred.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fred.rb b/fred.rb index a9ddf2d..46eb720 100644 --- a/fred.rb +++ b/fred.rb @@ -1,7 +1,11 @@ class Fred - attr_accessor :occupation + attr_accessor :occupation, :age def initialize(v) @occupation = v end + + def to_s + "Fred is an #{occupation} and #{age} years old." + end end