Class: Rspamd::Service
- Inherits:
-
Object
- Object
- Rspamd::Service
- Defined in:
- lib/rspamd/service.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #get(path) ⇒ Object
-
#initialize(configuration) ⇒ Service
constructor
A new instance of Service.
- #post(path, body: nil, headers: {}) ⇒ Object
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
#configuration ⇒ Object (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 |