Module: TTY::Option::Inheritance
- Defined in:
- lib/tty/option.rb
Instance Method Summary collapse
-
#inherited(subclass) ⇒ Object
When class is inherited copy over parameter definitions This allows for definition of global parameters without affecting child class parameters and vice versa.
Instance Method Details
#inherited(subclass) ⇒ Object
When class is inherited copy over parameter definitions This allows for definition of global parameters without affecting child class parameters and vice versa.
27 28 29 30 |
# File 'lib/tty/option.rb', line 27 def inherited(subclass) subclass.instance_variable_set(:@parameters, @parameters.dup) super end |