Discussion on Ruby's `alias`

See the below link:

Jay Fields' Thoughts: Ruby: Alias method alternative

Avoiding exposure of the old method can also be achieved by making it private.

And people who cursed me and tried repeatedly to be off-topic by
pointing me to the other users, to whom I am not familiarized with
anyway instead.

people here have very bad conception,they did have time to get busy with
bad discussions.

I'd be careful about making statements about people's perceptions.
After all, you get to know them only through *your* perception.
Usually it is much more successful to listen carefully to feedback and
take it as fact instead of claiming it's the others who do not see
reality. I don't have the time to go into more detail but the concept
of "reality" is actually quite a complex one and there are various
theories around that. I personally find this one pretty convincing:

The interesting part is here:

Cheers

robert

···

On Thu, Feb 28, 2013 at 6:28 PM, Tukai Patra <lists@ruby-forum.com> wrote:

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

Surely the very last line of my session (which you neatly removed from your quote) is calling it 'from the outside of the class'?

···

On 28.02.2013 12:51, Tukai Patra wrote:

Alex Gutteridge wrote in post #1099529:

On 28.02.2013 12:34, Tukai Patra wrote:

old_show

Uh, yes you just call it, unless I totally misunderstand your question?

class Foo
   def bar
     puts "bar"
   end
end
     ==>nil
class Foo
   alias :baz :bar
   def bar
     puts "baz"
     baz
   end
end

in the above you put `baz` inside `bar`, thus you were able. I am
telling without putting it into any instance method, can we call it,from
the outside of the class?

Hope myself cleard now my intention.

--
Alex Gutteridge

The alias keywords creates a new instance method in the class, no
different (from the outside) than any other methods you define on it:

1.9.2p290 :001 > class Test
1.9.2p290 :002?> def m
1.9.2p290 :003?> end
1.9.2p290 :004?> end
=> nil
1.9.2p290 :006 > Test.instance_methods(false)
=> [:m]
1.9.2p290 :007 > class Test
1.9.2p290 :008?> alias :old_m :m
1.9.2p290 :009?> end
=> nil
1.9.2p290 :010 > Test.instance_methods(false)
=> [:m, :old_m]

Jesus.

···

On Thu, Feb 28, 2013 at 2:02 PM, Tukai Patra <lists@ruby-forum.com> wrote:

Alex Gutteridge wrote in post #1099529:

On 28.02.2013 12:34, Tukai Patra wrote:

Yes the below one I was looking for if possible or not. Can you explain
how does it possible? what internal task ruby did for that call?

foo.baz
bar
     ==>nil

Sorry I overlooked it :slight_smile:

Ryan, you're considerably more annoying than him.

Please stop. Take a walk in the part, enjoy the nature, drop the bullshit posts.

···

--
Matma Rex

Robert Klemme wrote in post #1099574:

···

On Thu, Feb 28, 2013 at 4:50 PM, Tukai Patra <lists@ruby-forum.com> > wrote:

@Hans - Yes I do understand how `alias` works. Might be you didn't catch
my aim. I have a hope anyone out there might understood my intention.

Thanks Robert.

--
Posted via http://www.ruby-forum.com/\.

Arup,

I have no idea what your point was but if you've simply tried it in
REPL you could've seen it yourself.
https://gist.github.com/toraritte/5063028

regards
Attila

···

On Fri, Mar 1, 2013 at 7:58 AM, Robert Klemme <shortcutter@googlemail.com> wrote:

On Thu, Feb 28, 2013 at 6:28 PM, Tukai Patra <lists@ruby-forum.com> wrote:

See the below link:

Jay Fields' Thoughts: Ruby: Alias method alternative

Avoiding exposure of the old method can also be achieved by making it private.

And people who cursed me and tried repeatedly to be off-topic by
pointing me to the other users, to whom I am not familiarized with
anyway instead.

people here have very bad conception,they did have time to get busy with
bad discussions.

I'd be careful about making statements about people's perceptions.
After all, you get to know them only through *your* perception.
Usually it is much more successful to listen carefully to feedback and
take it as fact instead of claiming it's the others who do not see
reality. I don't have the time to go into more detail but the concept
of "reality" is actually quite a complex one and there are various
theories around that. I personally find this one pretty convincing:
Constructivism (philosophy of science) - Wikipedia

The interesting part is here:
Constructivism (philosophy of science) - Wikipedia

Cheers

robert

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

Attila Gulyas wrote in post #1099675:

Arup,

I have no idea what your point was but if you've simply tried it in
REPL you could've seen it yourself.
https://gist.github.com/toraritte/5063028

regards
Attila

On Fri, Mar 1, 2013 at 7:58 AM, Robert Klemme

Thanks for your github link. I explained my confusion above. And after
that I found the link I shared. That link and your link both proved
that,yes what I was looking for possible.

and please don't ask me as "Arup". My name is "Tukai".

Some people was barking there, let them bark. Might they had a dream
about such, and typed here also. I don't care at their barks.

But thanks to you and Robert and Jesús to share valuable in-formations.

···

--
Posted via http://www.ruby-forum.com/\.