Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7219

Re: "Put" in Ruby

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: "Put" in Ruby
Date 2016-04-16 01:45 +0200
Message-ID <dndcohFd463U1@mid.individual.net> (permalink)
References <d720c9a9-3943-45d9-83a1-ff3cf224aaef@googlegroups.com> <m2inziaeew.fsf@gmail.com>

Show all headers | View raw


On 15.04.2016 20:57, Sebastian Christ wrote:

> irb(main):001:0> RUBY_VERSION
> => "2.3.0"
> irb(main):002:0> puts.class
>
> => NilClass
> irb(main):003:0>
>
> Looks like `puts' is an instance of NilClass. And therefore an object.

This is ridiculous - or an attempt at humor.  You invoke .class on the 
result of invoking puts - not on puts.

irb(main):001:0> method :puts
=> #<Method: Object(Kernel)#puts>
irb(main):002:0> _.owner
=> Kernel

Cheers

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

"Put" in Ruby Cai Gengyang <gengyangcai@gmail.com> - 2016-04-15 08:23 -0700
  Re: "Put" in Ruby Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-15 20:57 +0200
    Re: "Put" in Ruby Robert Klemme <shortcutter@googlemail.com> - 2016-04-16 01:45 +0200
      Re: "Put" in Ruby Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-16 11:52 +0200
        Re: "Put" in Ruby Robert Klemme <shortcutter@googlemail.com> - 2016-04-16 13:40 +0200
  Re: "Put" in Ruby Robert Klemme <shortcutter@googlemail.com> - 2016-04-16 01:50 +0200
  Re: "Put" in Ruby Kaz Kylheku <545-066-4921@kylheku.com> - 2016-04-16 01:39 +0000

csiph-web