class Plugin::Extract::Calc

Public Class Methods

new(message, condition, operators = Plugin.filtering(:extract_operator, Set.new).first) click to toggle source
# File core/plugin/extract/extract.rb, line 42
def initialize(message, condition, operators = Plugin.filtering(:extract_operator, Set.new).first)
  type_strict condition => Plugin::Extract::ExtensibleCondition, operators => Enumerable
  @message, @condition, @operators = message, condition, operators
end

Public Instance Methods

call(*args) click to toggle source
# File core/plugin/extract/extract.rb, line 54
def call(*args)
  @condition.(*args, message: @message) end
method_missing(method_name, *args) click to toggle source
Calls superclass method
# File core/plugin/extract/extract.rb, line 47
def method_missing(method_name, *args)
  operator = @operators.find{ |_| _.slug == method_name }
  if operator
    @condition.(*args, message: @message, operator: operator.slug, &operator)
  else
    super end end