Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Extend Class to include attr?

Thread Tools

Extend Class to include attr?

Mark T
Posts: n/a
Can I extend a class to add an attr_accessor?
So that getter & setter are created?


Reply With Quote
Robert Klemme
Posts: n/a
On 15.04.2010 05:30, Mark T wrote:
> Can I extend a class to add an attr_accessor?
> So that getter& setter are created?


> How?

class AnyClass
attr_accessor :foo

Kind regards


remember.guy do |as, often| as.you_can - without end
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
extend class: include factories functions inside constructor aspineux Python 3 08-18-2011 03:09 PM
sending extend and include to your own class definition rlf Ruby 1 05-22-2009 09:01 PM
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
Extend the Membership Provider to include more user data =?Utf-8?B?Um9iIEtheQ==?= ASP .Net 5 01-06-2006 06:47 PM
#extend_object only for #extend and not #include Gavin Kistner Ruby 5 10-23-2004 10:03 AM