Class: PuppetEditorServices::Server::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_editor_services/server/base.rb

Direct Known Subclasses

Stdio, Tcp

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_options, connection_options, protocol_options, handler_options) ⇒ Base

Returns a new instance of Base.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/puppet_editor_services/server/base.rb', line 16

def initialize(server_options, connection_options, protocol_options, handler_options)
  @server_options = server_options.nil? ? {} : server_options.dup
  @connection_options = connection_options.nil? ? {} : connection_options.dup
  @protocol_options = protocol_options.nil? ? {} : protocol_options.dup
  @handler_options = handler_options.nil? ? {} : handler_options.dup

  @connection_options[:class] = PuppetEditorServices::Connection::Base if @connection_options[:class].nil?
  @protocol_options[:class] = PuppetEditorServices::Protocol::Base if @protocol_options[:class].nil?
  @handler_options[:class] = PuppetEditorServices::Handler::Base if @handler_options[:class].nil?

  @server_options[:servicename] = 'LANGUAGE SERVER' if @server_options[:servicename].nil?

  # Assumes there's only ONE active simpler server running at a time.
  PuppetEditorServices::Server.current_server = self
end

Instance Attribute Details

#connection_optionsObject (readonly)

Returns the value of attribute connection_options.



10
11
12
# File 'lib/puppet_editor_services/server/base.rb', line 10

def connection_options
  @connection_options
end

#handler_optionsObject (readonly)

Returns the value of attribute handler_options.



10
11
12
# File 'lib/puppet_editor_services/server/base.rb', line 10

def handler_options
  @handler_options
end

#protocol_optionsObject (readonly)

Returns the value of attribute protocol_options.



10
11
12
# File 'lib/puppet_editor_services/server/base.rb', line 10

def protocol_options
  @protocol_options
end

#server_optionsObject (readonly)

Returns the value of attribute server_options.



10
11
12
# File 'lib/puppet_editor_services/server/base.rb', line 10

def server_options
  @server_options
end

Instance Method Details

#connection(connection_id) ⇒ Object

Returns a client connection for a given connection_id



33
# File 'lib/puppet_editor_services/server/base.rb', line 33

def connection(connection_id); end

#log(message) ⇒ Object



37
38
39
# File 'lib/puppet_editor_services/server/base.rb', line 37

def log(message)
  PuppetEditorServices.log_message(:debug, "#{name}: #{message}")
end

#nameObject



12
13
14
# File 'lib/puppet_editor_services/server/base.rb', line 12

def name
  'SRV'
end

#startObject



35
# File 'lib/puppet_editor_services/server/base.rb', line 35

def start; end