Class: NSILapesi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/nsi-lapesi/configuration.rb

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
# File 'lib/nsi-lapesi/configuration.rb', line 19

def configure
  yield self if block_given?
  settings
end

.host(host = nil) ⇒ Object



4
5
6
7
# File 'lib/nsi-lapesi/configuration.rb', line 4

def host(host = nil)
  @host = host unless host.nil?
  @host
end

.path(path = nil) ⇒ Object



14
15
16
17
# File 'lib/nsi-lapesi/configuration.rb', line 14

def path(path = nil)
  @path = path unless path.nil?
  @path
end

.port(port = nil) ⇒ Object



9
10
11
12
# File 'lib/nsi-lapesi/configuration.rb', line 9

def port(port = nil)
  @port = port unless port.nil?
  @port
end

.settingsObject



24
25
26
# File 'lib/nsi-lapesi/configuration.rb', line 24

def settings
  {host: @host, port: @port, path: @path}
end