Class: Declarative::Builder::Builders

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

Instance Method Summary collapse

Instance Method Details

#<<(proc) ⇒ Object



19
20
21
# File 'lib/declarative/builder.rb', line 19

def <<(proc)
  super Trailblazer::Option( proc )
end

#call(context, *args, **options) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/declarative/builder.rb', line 11

def call(context, *args, **options)
  each do |block|
    klass = block.(*args, exec_context: context, keyword_arguments: options) and return klass # Trailblazer::Option#call()
  end

  context
end