cappy has quit [Killed (lithium.libera.chat (Nickname regained by services))]
cappy_ is now known as cappy
cahoots has quit [Ping timeout: 260 seconds]
wbooze has joined #ruby
wbooze has quit [Ping timeout: 260 seconds]
cahoots has joined #ruby
__jmcantrell__ has joined #ruby
cahoots has quit [Ping timeout: 245 seconds]
cappy has quit [Quit: Leaving]
__jmcantrell__ has quit [Ping timeout: 268 seconds]
madcabbage has joined #ruby
cahoots has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
__jmcantrell__ has joined #ruby
__jmcantrell__ has quit [Quit: WeeChat 4.5.2]
__jmcantrell__ has joined #ruby
cahoots has joined #ruby
cahoots has quit [Ping timeout: 248 seconds]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 268 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
cahoots has joined #ruby
cahoots has quit [Ping timeout: 260 seconds]
nil78 has quit [Read error: Connection reset by peer]
cahoots has joined #ruby
nil78 has joined #ruby
cahoots has quit [Ping timeout: 268 seconds]
madcabbage has quit [Ping timeout: 245 seconds]
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
nil78 has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
nil78 has joined #ruby
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
user71 has joined #ruby
__jmcantrell__ has quit [Quit: WeeChat 4.5.2]
Linux_Kerio has joined #ruby
cappy has joined #ruby
infinityfye has joined #ruby
wbooze has joined #ruby
Guest84 has joined #ruby
<Guest84>
Is there a way to pass information from an external variable inside a call to instance_eval?
<Guest84>
For example suppose I have a set of boxes which can only contain a certain type of objects, and after the program starts one of these boxes will be randomly selected to have an additional requirement on its contents. There's a logic object that contains the rules for all the boxes, and I'm trying to use instance_eval with the logic object to create
<Guest84>
a new rule for the special box. But the instance_eval can't know what box to check for the old ruleset, because that information is only determined by a different part of the program that picks a random box
<Guest84>
rough code example: chosen_box = boxes.sample(rng); @logic.instance_eval do {old_req = method(box.req); def special_req { return old_req.call() and extra_requirement() } } <-- instance_eval can't determine what "box" is, or box_id or whatever method I could use from outside the block
<Guest84>
even assuming "chosen_box" and "box" were the same identifier, but I assume that typo is clear enough
user71 has quit [Quit: Leaving]
Inline has quit [Ping timeout: 272 seconds]
Inline has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
luna__ has joined #ruby
o0x1eef has quit [Ping timeout: 252 seconds]
luna__ has left #ruby [#ruby]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 248 seconds]
fantazo has quit [Quit: Lost terminal]
sandra has quit [Remote host closed the connection]
sandra has joined #ruby
wbooze has quit [Quit: Leaving]
Obsdark has joined #ruby
Obsdark has quit [Changing host]
Obsdark has joined #ruby
graywolf has joined #ruby
Inline has quit [Ping timeout: 252 seconds]
Inline has joined #ruby
Inline has quit [Remote host closed the connection]
user71 has joined #ruby
cappy has quit [Quit: Leaving]
graywolf has quit [Quit: WeeChat 4.5.2]
eoli3n has quit [Remote host closed the connection]
eoli3n has joined #ruby
wbooze has joined #ruby
reset has quit [Quit: reset]
hwpplayer1 has joined #ruby
hwpplayer1 has quit [Read error: Connection reset by peer]
wbooze has quit [Ping timeout: 244 seconds]
cahoots has joined #ruby
o0x1eef has joined #ruby
Guest84 has quit [Quit: Client closed]
cahoots has quit [Ping timeout: 252 seconds]
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
nil78 has quit [Read error: Connection reset by peer]