Ezra Zygmuntowicz
1/2/2006 7:42:00 AM
On Jan 1, 2006, at 11:27 PM, Une bévue wrote:
> Benjamin Stiglitz <ben@tanjero.com> wrote:
>
>> ri Object::new
> ~/Desktop/ruby-1.8.4%> ri Object::new
> ------------------------------------------------------------
> Object::new
> Object::new()
> ----------------------------------------------------------------------
> --
> Not documented
> ~/Desktop/ruby-1.8.4%> ri Kernel#p
> zsh: no matches found: Kernel#p
>
> just for fun )))
> --
> une bévue
>
(~/):~>$: ri "Kernel#p"
--------------------------------------------------------------- Kernel#p
p(obj, ...) => nil
------------------------------------------------------------------------
For each object, directly writes obj.inspect followed by the
current output record separator to the program's standard output.
p bypasses the Ruby I/O libraries.
S = Struct.new(:name, :state)
s = S['dave', 'TX']
p s
produces:
#<S name="dave", state="TX">
you need to quote it because of the # char
Cheers-
Ezra