Sha256: ecdc7bd7236fd51fcf3e663d6e191a33ecdc0c19f0bede7959ec5417d2b27f43
Contents?: true
Size: 919 Bytes
Versions: 1
Compression:
Stored size: 919 Bytes
Contents
# frozen_string_literal: true module Damn module Legacy module DSL def const_missing(name) const_set(name, Class.new) end def meth(methods, _opts = {}) Store.instance.add_meth(self, methods) end def step(&block) raise ArgumentError, "No block provided" unless block_given? val = block.call if val.nil? head, = Store.instance.stack.shift return head.to_s end if !Store.instance.stack.empty? && self == Store.instance.stack.first[1] each do |key| Store.instance.add(key, val) end else head, = Store.instance.stack.shift if head && is_a?(Array) each do |key| Store.instance.add(key, head) end end end self end def plot Mermaid.call end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
damn-legacy-0.0.2 | lib/damn/legacy/dsl.rb |