Sha256: be34fb736125a0d4cba89382241688d684832fa3d20ee845cf31ba2a457c98d3
Contents?: true
Size: 547 Bytes
Versions: 9
Compression:
Stored size: 547 Bytes
Contents
module Danica class Equation::Builder attr_reader :variables def initialize(*variables, &block) @variables = variables instance_eval(&block) end def build vars = variables l = left r = right Class.new(Equation) do variables(*vars) define_method :left, l define_method :right, r end end def left(&block) @left = block if block_given? @left end def right(&block) @right = block if block_given? @right end end end
Version data entries
9 entries across 9 versions & 1 rubygems