Skip to content

Commit

Permalink
Use class instead of struct for BreakNode
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Oct 12, 2024
1 parent ec36e0c commit 2d8ce28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/zaid/nodes/break_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

module Zaid
module Nodes
BreakNode = Struct.new do
class BreakNode
def eval(_context)
raise BreakException
end

def ==(other)
other.is_a?(BreakNode)
end
end

class BreakException < StandardError; end
Expand Down

0 comments on commit 2d8ce28

Please sign in to comment.