Class: Jubatus::Burst::Document
- Inherits:
-
Object
- Object
- Jubatus::Burst::Document
- Includes:
- Common
- Defined in:
- lib/jubatus/burst/types.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pos, text) ⇒ Document
constructor
A new instance of Document.
- #to_msgpack(out = '') ⇒ Object
- #to_s ⇒ Object
Methods included from Common
Constructor Details
#initialize(pos, text) ⇒ Document
Returns a new instance of Document.
115 116 117 118 |
# File 'lib/jubatus/burst/types.rb', line 115 def initialize(pos, text) @pos = pos @text = text end |
Instance Attribute Details
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
139 140 141 |
# File 'lib/jubatus/burst/types.rb', line 139 def pos @pos end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
139 140 141 |
# File 'lib/jubatus/burst/types.rb', line 139 def text @text end |
Class Method Details
Instance Method Details
#to_msgpack(out = '') ⇒ Object
120 121 122 123 |
# File 'lib/jubatus/burst/types.rb', line 120 def to_msgpack(out = '') t = [@pos, @text] return TYPE.to_msgpack(t) end |
#to_s ⇒ Object
130 131 132 133 134 135 136 137 |
# File 'lib/jubatus/burst/types.rb', line 130 def to_s gen = Jubatus::Common::MessageStringGenerator.new gen.open("document") gen.add("pos", @pos) gen.add("text", @text) gen.close() return gen.to_s end |