Ruby on Rails
Saturday, October 11, 2014
Thanks Mike.
===================
Alexandre Mondaini Calvão
"Nossa recompensa se encontra no esforço e não no resultado. Um esforço total é uma vitória completa." [Ghandi]
2014-10-10 13:31 GMT-03:00 Mike <local.mat@gmail.com>:
--You might want something like this.class FooendFoo.instance_eval dodef class_nameendendclass Bar < Fooendclass Tar < Fooendputs Foo.class_name#=> Fooputs Bar.class_name#=> Barputs Tar.class_name#=> Tar
On Thursday, October 9, 2014 8:27:10 PM UTC-7, Alexandre Calvão wrote:Is not instance method, is class method... My bad
===================
Alexandre Mondaini Calvão
"Nossa recompensa se encontra no esforço e não no resultado. Um esforço total é uma vitória completa." [Ghandi]2014-10-10 0:17 GMT-03:00 Alexandre Calvão <apo...@gmail.com>:Is there a way for me to do that on ruby ?class Foodef self.class_nameendendclass Bar < Fooendclass Tar < FooendBar.class_name= 'Bar'Tar.class_name= 'Tar'I want to get the class name of the class who called the instance method from the parent class.I tried the code above and it keeps getting me 'Class' as the result.Is that possible in ruby ?[]`s
===================
Alexandre Mondaini Calvão
"Nossa recompensa se encontra no esforço e não no resultado. Um esforço total é uma vitória completa." [Ghandi]
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/87114137-56e1-4a12-97f6-ef2f0511b988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BaBw4SDgn3qEnZEOWum2jJSu5EBnb2dinhsMro8J-H5%2B9OmEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment