Forum: Ruby on Rails Static variable

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E2c8aa5935b571e7613f87f58e150d12?d=identicon&s=25 Italo Matos (Guest)
on 2007-01-27 15:33
(Received via mailing list)
Who declare static variable in ruby ?


thks



--
Ítalo Matos
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-01-27 15:56
(Received via mailing list)
Italo Matos wrote:

> Who declare static variable in ruby ?

http://www.google.com/search?q=ruby+static+variable

--
  Phlip
  http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2007-01-27 16:59
(Received via mailing list)
Hi --

On Sat, 27 Jan 2007, Italo Matos wrote:

> Who declare static variable in ruby ?

The words "static" and "Ruby" don't mix very well :-)  Do you mean a
class variable?  Or a constant?


David

--
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
    (See what readers are saying!  http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)
E2c8aa5935b571e7613f87f58e150d12?d=identicon&s=25 Italo Matos (Guest)
on 2007-01-27 18:03
(Received via mailing list)
Constant ...

thks







2007/1/27, dblack@wobblini.net <dblack@wobblini.net>:
>
> >
>


--
Ítalo Matos
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2007-01-27 18:16
(Received via mailing list)
Hi --

On Sat, 27 Jan 2007, Italo Matos wrote:

> Constant ...

Constants are defined in a class or module.  I don't know what further
information you need, based on your question, but that's the most
basic point.


David

--
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
    (See what readers are saying!  http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)
E2c8aa5935b571e7613f87f58e150d12?d=identicon&s=25 Italo Matos (Guest)
on 2007-01-27 18:28
(Received via mailing list)
Example in Java :

public class Service {
      public static final int EMAIL = 1;
      public static final int SMS = 2;
}





2007/1/27, dblack@wobblini.net <dblack@wobblini.net>:
> basic point.
>
> >
>


--
Ítalo Matos
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2007-01-27 18:46
(Received via mailing list)
On Jan 27, 2007, at 12:26 PM, Italo Matos wrote:
> Example in Java :
>
> public class Service {
>       public static final int EMAIL = 1;
>       public static final int SMS = 2;
> }

module Service
   EMAIL = 1
   SMS = 2
end

referenced later as:
Service::EMAIL
and
Service::SMS

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
This topic is locked and can not be replied to.