Class: DNS::Server
- Inherits:
-
Object
- Object
- DNS::Server
- Defined in:
- lib/faildns/server.rb,
lib/faildns/server/dispatcher.rb,
lib/faildns/server/dispatcher/event.rb,
lib/faildns/server/dispatcher/socket.rb,
lib/faildns/server/dispatcher/eventdispatcher.rb,
lib/faildns/server/dispatcher/connectiondispatcher.rb
Defined Under Namespace
Classes: Dispatcher
Instance Attribute Summary collapse
-
#dispatcher ⇒ Object
readonly
Returns the value of attribute dispatcher.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #fire(*args) ⇒ Object
-
#initialize(options = {}) ⇒ Server
constructor
A new instance of Server.
- #observe(*args) ⇒ Object
- #register(*args) ⇒ Object
- #start ⇒ Object
- #stopping ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/faildns/server.rb', line 28 def initialize (={}) if !.is_a? Hash raise ArgumentError.new('You have to pass a Hash') end @options = @dispatcher = Dispatcher.new(self) if block_given? yield self end end |
Instance Attribute Details
#dispatcher ⇒ Object (readonly)
Returns the value of attribute dispatcher.
26 27 28 |
# File 'lib/faildns/server.rb', line 26 def dispatcher @dispatcher end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
26 27 28 |
# File 'lib/faildns/server.rb', line 26 def @options end |
Instance Method Details
#fire(*args) ⇒ Object
66 67 68 |
# File 'lib/faildns/server.rb', line 66 def fire (*args) @dispatcher.event.fire(*args) end |
#observe(*args) ⇒ Object
62 63 64 |
# File 'lib/faildns/server.rb', line 62 def observe (*args) @dispatcher.event.observe(*args) end |
#register(*args) ⇒ Object
58 59 60 |
# File 'lib/faildns/server.rb', line 58 def register (*args) @dispatcher.event.register(*args) end |
#start ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/faildns/server.rb', line 42 def start if @started return end @started = true @dispatcher.start end |
#stopping ⇒ Object
52 53 54 55 56 |
# File 'lib/faildns/server.rb', line 52 def stopping @stopping = true @dispatcher.stop end |