Sha256: 80afd41fefead0b78cf03271a86301397a3125a78838d96a90a757fc5c2253de
Contents?: true
Size: 621 Bytes
Versions: 15
Compression:
Stored size: 621 Bytes
Contents
module Geny module Context # @api private class Base attr_reader :command, :locals def initialize(command:, locals: {}) @locals = locals @command = command @command.helpers.each { |h| extend h } end private def respond_to_missing?(meth, *) locals.key?(meth) || super end def method_missing(meth, *args) return super unless locals.key?(meth) unless args.empty? raise ArgumentError, "wrong number of arguments (given #{args.length}, expected 0)" end locals[meth] end end end end
Version data entries
15 entries across 15 versions & 1 rubygems