Class: AMON::Document Abstract
- Inherits:
-
Object
- Object
- AMON::Document
- Includes:
- JSONHelper
- Defined in:
- lib/amon/document.rb
Overview
This class is abstract.
A top-level object representing an AMON resource
Direct Known Subclasses
Instance Attribute Summary collapse
-
#session ⇒ Session
readonly
The session associated with this document.
Attributes included from JSONHelper
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Two documents are equal if they have the same class and their id fields are equal.
-
#id ⇒ Object
abstract
This should be implemented in subclasses, returning the UUID for the document.
-
#initialize(session, json) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(session, json) ⇒ Document
Returns a new instance of Document.
12 13 14 |
# File 'lib/amon/document.rb', line 12 def initialize(session, json) @session, @json = session, json end |
Instance Attribute Details
#session ⇒ Session (readonly)
Returns The session associated with this document.
8 9 10 |
# File 'lib/amon/document.rb', line 8 def session @session end |
Instance Method Details
#==(other) ⇒ Boolean
Two documents are equal if they have the same class and their id fields are equal
26 27 28 |
# File 'lib/amon/document.rb', line 26 def ==(other) self.class == other.class && id == other.id end |
#id ⇒ Object
This method is abstract.
This should be implemented in subclasses, returning the UUID for the document
19 20 21 |
# File 'lib/amon/document.rb', line 19 def id raise NotImplementedError end |