Class: IngestElement

Inherits:
Object
  • Object
show all
Defined in:
lib/netuitive/ingest_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, type, location, metrics, samples, tags, attributes) ⇒ IngestElement

Returns a new instance of IngestElement.



4
5
6
7
8
9
10
11
12
13
# File 'lib/netuitive/ingest_element.rb', line 4

def initialize(id, name, type, location, metrics, samples, tags, attributes)
    @id=id
    @name=name
    @type=type
    @location=location
    @metrics=metrics
    @samples=samples
    @tags=tags
    @attributes=attributes
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def attributes
  @attributes
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def id
  @id
end

#locationObject

Returns the value of attribute location.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def location
  @location
end

#metricsObject

Returns the value of attribute metrics.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def metrics
  @metrics
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def name
  @name
end

#samplesObject

Returns the value of attribute samples.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def samples
  @samples
end

#tagsObject

Returns the value of attribute tags.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def tags
  @tags
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/netuitive/ingest_element.rb', line 3

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



14
15
16
# File 'lib/netuitive/ingest_element.rb', line 14

def to_json(options = {})
    {'id' => @id, 'name' => @name, 'type' => @type, 'location' => @location, 'metrics' => @metrics, 'samples' => @samples,'tags' => @tags, 'attributes' => @attributes}.to_json.tr('\\', '')
end