Class: InternetBoxLogger::GenericBox

Inherits:
Object
  • Object
show all
Includes:
ElasticSearch
Defined in:
lib/internet_box_logger/generic_box.rb

Instance Method Summary collapse

Methods included from ElasticSearch

#elasticsearch_client, #save

Constructor Details

#initialize(box_type) ⇒ GenericBox

Returns a new instance of GenericBox.



7
8
9
10
11
12
# File 'lib/internet_box_logger/generic_box.rb', line 7

def initialize(box_type)
  box_type = box_type.to_s if box_type.is_a? Symbol
  box_type = self.class.const_get box_type if box_type.is_a? String
  box_parser_module = box_type if InternetBoxLogger::Parsers[].include? box_type
  self.extend box_parser_module
end

Instance Method Details

#log_box_infoObject



14
15
16
# File 'lib/internet_box_logger/generic_box.rb', line 14

def log_box_info
  save if get_box_data
end