Re: [ruby-de] RE: [ruby-de] Re: [ruby-de] Re: [ruby-d e] R e: [ruby-d e] Problem Klassenvariable über schreiben

Winfried Mueller <[email protected]>
Newsgroups gmane.comp.lang.ruby.german
Message-ID <[email protected]>
Hallo Christoph,


[...]
># Autmatisierte Version
>
>class Class
>  def class_attr_accessor (sym, instance_visibility = protected, 
>                           class_visibility  = private )
>    class_eval <<-attr_body
>      #{instance_visibility} 
>      def #{sym.to_s}; type.#{sym.to_s} end
>      def #{sym.to_s}=(rhs); type.#{sym.to_s}=(rhs) end
>    attr_body
>    class << self; self end.send(:attr_reader,sym,class_visibility)
>    class << self; self end.send(:attr_writer,sym,class_visibility)
>  end
>end
[...]

Da schlackern mir ja die Ohren, wenn ich Deine Beispiele sehe.
Ich dachte, ich hätte schon ein wenig Durchblick, was ruby
angeht. Jetzt weiß ich, ich weiß noch sehr wenig.

Brauch wohl jetzt einige Zeit, um Deine Code zu verstehen...

alle Achtung

Winni
--
:: Integrales Handeln Dortmund ::
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.