Sha256: 71a497ab1e7a6d79e72d866f9c38c2a5c9fcd35d7ccadcf21a495130a698e7b4
Contents?: true
Size: 608 Bytes
Versions: 2
Compression:
Stored size: 608 Bytes
Contents
# frozen_string_literal: true module ROM::Factory module Attributes # @api private class Callable attr_reader :name, :dsl, :block # @api private def initialize(name, dsl, block) @name = name @dsl = dsl @block = block end # @api private def call(attrs, *args) result = attrs[name] || dsl.instance_exec(*args, &block) {name => result} end # @api private def value? true end # @api private def dependency_names block.parameters.map(&:last) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rom-factory-0.12.0 | lib/rom/factory/attributes/callable.rb |
rom-factory-0.11.0 | lib/rom/factory/attributes/callable.rb |