Class: LogStash::Modules::KibanaBase

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/modules/kibana_base.rb

Direct Known Subclasses

KibanaDashboards, KibanaSettings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(import_path, content) ⇒ KibanaBase

Returns a new instance of KibanaBase.



7
8
9
# File 'lib/logstash/modules/kibana_base.rb', line 7

def initialize(import_path, content)
  @import_path, @content = import_path, content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



5
6
7
# File 'lib/logstash/modules/kibana_base.rb', line 5

def content
  @content
end

#import_pathObject (readonly)

Returns the value of attribute import_path.



5
6
7
# File 'lib/logstash/modules/kibana_base.rb', line 5

def import_path
  @import_path
end

Instance Method Details

#content_as_objectObject



19
20
21
22
# File 'lib/logstash/modules/kibana_base.rb', line 19

def content_as_object
  return content unless content.is_a?(String)
  LogStash::Json.load(content) rescue nil
end

#import(client) ⇒ Object

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/logstash/modules/kibana_base.rb', line 11

def import(client)
  raise NotImplementedError, "#{self.class.name} needs to implement `#import`"
end

#to_sObject



15
16
17
# File 'lib/logstash/modules/kibana_base.rb', line 15

def to_s
  import_path
end