Class: ProxyRb::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/proxy_rb/runtime.rb

Overview

Runtime of proxy_rb

Most methods are considered private. Please look for ‘(private)` in the attribute descriptions. Only a few like `#current_directory`, ’#root_directory` and ‘#config` are considered to be part of the public API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Runtime

Returns a new instance of Runtime.



27
28
29
30
31
32
33
# File 'lib/proxy_rb/runtime.rb', line 27

def initialize(opts = {})
  @event_bus       = EventBus.new(EventBus::NameResolver.new(ProxyRb::Events))
  @announcer       = opts.fetch(:announcer, ProxyRb::Announcer.new)
  @config          = opts.fetch(:config, ConfigurationWrapper.new(ProxyRb.config.make_copy, @event_bus))

  @setup_done = false
end

Instance Attribute Details

#announcerObject

Announce information



25
# File 'lib/proxy_rb/runtime.rb', line 25

attr_accessor :config, :announcer, :event_bus

#configObject

Access configuration of proxy_rb



25
26
27
# File 'lib/proxy_rb/runtime.rb', line 25

def config
  @config
end

#event_busObject

Handle events (private)



25
# File 'lib/proxy_rb/runtime.rb', line 25

attr_accessor :config, :announcer, :event_bus

Instance Method Details

#setup_already_done?Boolean

Has proxy_rb already been setup. Should be used only internally.

Returns:

  • (Boolean)


45
46
47
# File 'lib/proxy_rb/runtime.rb', line 45

def setup_already_done?
  @setup_done == true
end

#setup_doneObject

Setup of proxy_rb is finshed. Should be used only internally.



38
39
40
# File 'lib/proxy_rb/runtime.rb', line 38

def setup_done
  @setup_done = true
end