Class: Lateral::Document
- Inherits:
-
Object
- Object
- Lateral::Document
- Defined in:
- lib/lateral/document.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(args) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(args) ⇒ Document
5 6 7 8 9 10 |
# File 'lib/lateral/document.rb', line 5 def initialize(args) @id = args.fetch 'document_id' @created_at = args.fetch 'created_at' @text = args.fetch 'text' @meta = args.fetch 'meta', {} end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/lateral/document.rb', line 3 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/lateral/document.rb', line 3 def id @id end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
3 4 5 |
# File 'lib/lateral/document.rb', line 3 def @meta end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/lateral/document.rb', line 3 def text @text end |