From b3a13e5845b92ae9520b93113c4030114b2d6331 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Mon, 6 Jun 2022 13:27:42 -0700 Subject: Automatically define a method for ICs. --- library.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'library.rb') diff --git a/library.rb b/library.rb index bddcdea..71377dc 100644 --- a/library.rb +++ b/library.rb @@ -26,7 +26,7 @@ $ic = "TSSOP" def define_ic(name, value, pincount, *subparts, &automatic) parts = [] - proc do + define_singleton_method(name, lambda do if parts.size < 1 ic = comp("U", "#{$ic}-#{pincount}", name, value) automatic.call(ic) @@ -46,7 +46,7 @@ def define_ic(name, value, pincount, *subparts, &automatic) end end parts.shift - end + end) end def stock_ic(name, value, &automatic) -- cgit v1.2.3