class Verto::DSL::Hook
Attributes
moment[RW]
Public Class Methods
new(interpreter: DSL.interpreter, moment: :before, &block)
click to toggle source
# File lib/verto/dsl/hook.rb, line 8 def initialize(interpreter: DSL.interpreter, moment: :before, &block) @moment = moment.to_sym @interpreter = interpreter @block = block end
Public Instance Methods
call(with_attributes: {})
click to toggle source
# File lib/verto/dsl/hook.rb, line 14 def call(with_attributes: {}) @interpreter.evaluate(attributes: with_attributes, &@block) end