Class: Declarative::Heritage
- Inherits:
-
Array
- Object
- Array
- Declarative::Heritage
- Defined in:
- lib/declarative/heritage.rb
Defined Under Namespace
Modules: DSL, Included, Inherited
Instance Method Summary collapse
-
#call(inheritor, &block) ⇒ Object
Replay the recorded assignments on inheritor.
-
#record(method, *args, &block) ⇒ Object
Record inheritable assignments for replay in an inheriting class.
Instance Method Details
#call(inheritor, &block) ⇒ Object
Replay the recorded assignments on inheritor. Accepts a block that will allow processing the arguments for every recorded statement.
12 13 14 |
# File 'lib/declarative/heritage.rb', line 12 def call(inheritor, &block) each { |cfg| call!(inheritor, cfg, &block) } end |
#record(method, *args, &block) ⇒ Object
Record inheritable assignments for replay in an inheriting class.
6 7 8 |
# File 'lib/declarative/heritage.rb', line 6 def record(method, *args, &block) self << {method: method, args: DeepDup.(args), block: block} # DISCUSS: options.dup. end |