Class: Declarative::Heritage

Inherits:
Array
  • Object
show all
Defined in:
lib/declarative.rb

Instance Method Summary collapse

Instance Method Details

#call(inheritor) ⇒ Object



25
26
27
28
29
# File 'lib/declarative.rb', line 25

def call(inheritor)
  each do |cfg|
    inheritor.send(cfg[:method], *cfg[:args], &cfg[:block])
  end
end

#record(method, name, options = nil, &block) ⇒ Object



21
22
23
# File 'lib/declarative.rb', line 21

def record(method, name, options=nil, &block)
  self << {method: method, args: [name, options ? options.dup : nil].compact, block: block} # DISCUSS: options.dup.
end