Sha256: 471edd73337378e523e4ce4a23a571693a569220f1418c516c448c59aa7097ac
Contents?: true
Size: 570 Bytes
Versions: 10
Compression:
Stored size: 570 Bytes
Contents
module ActiveRepository module Callback class Base def initialize(object, method, options={}) @object = object @method = method @options = options end def call @object.send(@method) if can_run? end private def can_run? return @can_run if @can_run if_option = @options[:if].nil? ? true : @object.send(@options[:if]) unless_option = @options[:unless].nil? ? false : @object.send(@options[:unless]) @can_run = if_option && !unless_option end end end end
Version data entries
10 entries across 10 versions & 1 rubygems