Class: AMON::DocumentPart Abstract

Inherits:
Object
  • Object
show all
Includes:
JSONHelper
Defined in:
lib/amon/document_part.rb

Overview

This class is abstract.

An object representing part of an AMON Document. For example, a Reading is part of a Device, and cannot exist outside of it.

Direct Known Subclasses

Measurement, Metadata, Reading

Instance Attribute Summary collapse

Attributes included from JSONHelper

#json

Instance Method Summary collapse

Constructor Details

#initialize(parent, json) ⇒ DocumentPart

Returns a new instance of DocumentPart.

Parameters:

  • parent (Document)

    The parent document

  • json (Hash)

    The JSON data as a Hash



14
15
16
# File 'lib/amon/document_part.rb', line 14

def initialize(parent, json)
  @parent, @json = parent, json
end

Instance Attribute Details

#parentDocument (readonly)

Returns The parent document of which this object is a part.

Returns:

  • (Document)

    The parent document of which this object is a part



10
11
12
# File 'lib/amon/document_part.rb', line 10

def parent
  @parent
end