class Observed::Singleton

Public Instance Methods

configure(*args) click to toggle source
# File lib/observed.rb, line 45
def configure(*args)
  @context.configure *args
end
init!() click to toggle source

Call this method before you are going to build 2nd or later Observed configuration using this module. Refrain that `Observed` object is a builder for Observed configuration and it has global state. We have to reset its state via this `init!` method before building next configurations after the first one.

# File lib/observed.rb, line 34
def init!
  @context = Observed::Context.new
  @observed = @context.config_dsl
end
run(tag=nil, data=nil, options=nil) click to toggle source
# File lib/observed.rb, line 39
def run(tag=nil, data=nil, options=nil)
  sys = @context.system
  sys.config = @observed.config
  sys.send :run, *[tag, data, options].take_while { |a| a != nil }
end