class Uber::Builder::Constant
Computes the concrete target class.
Public Class Methods
new(constant, context)
click to toggle source
# File lib/uber/builder.rb, line 35 def initialize(constant, context) @constant = constant @context = context @builders = @constant.builders # only dependency, must be a Cell::Base subclass. end
Public Instance Methods
call(*args)
click to toggle source
# File lib/uber/builder.rb, line 41 def call(*args) build_class_for(*args) end
Private Instance Methods
build_class_for(*args)
click to toggle source
# File lib/uber/builder.rb, line 46 def build_class_for(*args) @builders.each do |blk| klass = run_builder_block(blk, *args) and return klass end @constant end
run_builder_block(block, *args)
click to toggle source
# File lib/uber/builder.rb, line 53 def run_builder_block(block, *args) block.(@context, *args) # Uber::Value.call() end