In PHP I can do this within a class's method:
Condition::evaluate($this, $primaryCondition);
This allows me to pass the entire instance of the class to a different class via $this. How can I achieve the same in Ruby?
In PHP I can do this within a class's method:
Condition::evaluate($this, $primaryCondition);
This allows me to pass the entire instance of the class to a different class via $this. How can I achieve the same in Ruby?
In ruby you have a self
keyword. You can read about it in this article, it explains how self
behave in different contexts.