Sha256: 5cad37dff3819f01a278a4994df42ef1383429ecd185e4c998fa10e7d6faa2a9
Contents?: true
Size: 401 Bytes
Versions: 15
Compression:
Stored size: 401 Bytes
Contents
module Rbexy module ComponentContext def rbexy_context @rbexy_context ||= [{}] end def create_context(name, value) rbexy_context.last[name] = value end def use_context(name) index = rbexy_context.rindex { |c| c.has_key?(name) } index ? rbexy_context[index][name] : raise(ContextNotFound, "no parent context `#{name}`") end end end
Version data entries
15 entries across 15 versions & 1 rubygems