Class: Wayfarer::Callbacks::ConditionalCallback

Inherits:
Struct
  • Object
show all
Defined in:
lib/wayfarer/callbacks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filtersObject

Returns the value of attribute filters

Returns:

  • (Object)

    the current value of filters



8
9
10
# File 'lib/wayfarer/callbacks.rb', line 8

def filters
  @filters
end

#jobObject

Returns the value of attribute job

Returns:

  • (Object)

    the current value of job



8
9
10
# File 'lib/wayfarer/callbacks.rb', line 8

def job
  @job
end

Instance Method Details

#run(method, &block) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/wayfarer/callbacks.rb', line 9

def run(method, &block)
  return if only && !applies?(only)
  return if except && applies?(except)

  return job.send(method) if method

  job.instance_eval(&block)
end