Class: Kanal::Plugins::Batteries::Specifics

Inherits:
Object
  • Object
show all
Includes:
Core::Logging
Defined in:
lib/kanal/plugins/batteries/specifics.rb

Overview

This class provides possibility to store custom key-value pairs in outputs

Instance Method Summary collapse

Constructor Details

#initializeSpecifics

Returns a new instance of Specifics.



14
15
16
# File 'lib/kanal/plugins/batteries/specifics.rb', line 14

def initialize
  @specifics = {}
end

Instance Method Details

#add(specific_name, specific_value) ⇒ Object



18
19
20
# File 'lib/kanal/plugins/batteries/specifics.rb', line 18

def add(specific_name, specific_value)
  @specifics[specific_name] = specific_value
end

#get(specific_name) ⇒ Object



22
23
24
25
26
# File 'lib/kanal/plugins/batteries/specifics.rb', line 22

def get(specific_name)
  return nil unless has? specific_name

  @specifics[specific_name]
end

#has?(specific_name) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/kanal/plugins/batteries/specifics.rb', line 28

def has?(specific_name)
  @specifics.key? specific_name
end