Displaying 2 results from an estimated 2 matches for "my_generic".
Did you mean:
_generic
2019 Aug 07
1
NextMethod() and argument laziness
...In this example, I would
like to call NextMethod() from my `child` object, have `cols` be left
untouched, and then substitute(cols) in the parent method. It works when
you use a `parent` object (as expected), but I would have also expected to
get `mpg` back when calling it from the `child` method.
my_generic <- function(x, cols) {
UseMethod("my_generic")
}
my_generic.parent <- function(x, cols) {
substitute(cols)
}
my_generic.child <- function(x, cols) {
NextMethod()
}
obj_parent <- structure(mtcars, class = c("parent", class(mtcars)))
obj_child <- structure(obj...
2006 Jul 18
2
Write a new generator
Hi,
Could anyone point me to how to write a generator in Ruby?
I was going through code in ruby files at
\rails-1.1.2\lib\rails_generatorand found that it reads gems
specification to look for generator s present
on the system.
The way there are tutorials on how to create plugins for Rails, are there
any for Generators?
At the end of it I should be able to do something like this
ruby