Sha256: 9e0ac4c0e70985d40b1a3e456266a35cba1883b00795b86bd0a4976a97b74a26
Contents?: true
Size: 506 Bytes
Versions: 12
Compression:
Stored size: 506 Bytes
Contents
# frozen_string_literal: true module EacCli class DocoptRunner # Provides the method context which search and call a method in self and ancestor objects. module Context def context(method) current = self while current return current.send(method) if current.respond_to?(method) current = current.respond_to?(:parent) ? current.parent : nil end raise "Context method \"#{method}\" not found for #{self.class}" end end end end
Version data entries
12 entries across 12 versions & 2 rubygems