Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/json_logic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.filter(logic, data)
end

def self.add_operation(operator, function)
Operation.class.send(:define_method, operator) do |v, d|
Operation.define_singleton_method(operator) do |v, d|
function.call(v, d)
end
end
Expand Down
6 changes: 0 additions & 6 deletions lib/json_logic/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,5 @@ def self.is_standard?(operator)
def self.is_iterable?(operator)
['filter', 'some', 'all', 'none', 'in', 'map', 'reduce'].include?(operator.to_s)
end

def self.add_operation(operator, function)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't seem like this was doing anything, so I took it out.
Happy to add it back if desired.

self.class.send(:define_method, operator) do |v, d|
function.call(v, d)
end
end
end
end