Class: Rspamd::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/rspamd/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Service

Returns a new instance of Service.



5
6
7
# File 'lib/rspamd/service.rb', line 5

def initialize(configuration)
  @configuration = configuration
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



3
4
5
# File 'lib/rspamd/service.rb', line 3

def configuration
  @configuration
end

Instance Method Details

#get(path) ⇒ Object



9
10
11
# File 'lib/rspamd/service.rb', line 9

def get(path)
  client.get path, default_headers
end

#post(path, body: nil, headers: {}) ⇒ Object



13
14
15
# File 'lib/rspamd/service.rb', line 13

def post(path, body: nil, headers: {})
  client.post path, body, default_headers.merge(headers.compact.transform_values(&:to_s))
end