On Apr 7, 3:31 am, Junior Junior wangsa <rails-mailing-l...@andreas-
s.net> wrote:
>
> can somebody explain this code?
>
> @nodestat = Node.all.map do |node|{
> :Status => PingExternal.new(node.ipadd)? "Online" : "Offline"}
> end
>
A brief overview of the docs (and general convention) suggests that
PingExternal.new doesn't do a ping, it just creates a pinger object -
all you are testing is whether that new object was nil or not.
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---