Class: Jubatus::Graph::Node
- Inherits:
-
Object
- Object
- Jubatus::Graph::Node
- Includes:
- Common
- Defined in:
- lib/jubatus/graph/types.rb
Constant Summary collapse
- TYPE =
TTuple.new(TMap.new(TString.new, TString.new), TList.new(TInt.new( false, 8)), TList.new(TInt.new(false, 8)))
Instance Attribute Summary collapse
-
#in_edges ⇒ Object
readonly
Returns the value of attribute in_edges.
-
#out_edges ⇒ Object
readonly
Returns the value of attribute out_edges.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(property, in_edges, out_edges) ⇒ Node
constructor
A new instance of Node.
- #to_msgpack(out = '') ⇒ Object
- #to_s ⇒ Object
Methods included from Common
Constructor Details
#initialize(property, in_edges, out_edges) ⇒ Node
Returns a new instance of Node.
16 17 18 19 20 |
# File 'lib/jubatus/graph/types.rb', line 16 def initialize(property, in_edges, out_edges) @property = property @in_edges = in_edges @out_edges = out_edges end |
Instance Attribute Details
#in_edges ⇒ Object (readonly)
Returns the value of attribute in_edges.
42 43 44 |
# File 'lib/jubatus/graph/types.rb', line 42 def in_edges @in_edges end |
#out_edges ⇒ Object (readonly)
Returns the value of attribute out_edges.
42 43 44 |
# File 'lib/jubatus/graph/types.rb', line 42 def out_edges @out_edges end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
42 43 44 |
# File 'lib/jubatus/graph/types.rb', line 42 def property @property end |
Class Method Details
Instance Method Details
#to_msgpack(out = '') ⇒ Object
22 23 24 25 |
# File 'lib/jubatus/graph/types.rb', line 22 def to_msgpack(out = '') t = [@property, @in_edges, @out_edges] return TYPE.to_msgpack(t) end |
#to_s ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/jubatus/graph/types.rb', line 32 def to_s gen = Jubatus::Common::MessageStringGenerator.new gen.open("node") gen.add("property", @property) gen.add("in_edges", @in_edges) gen.add("out_edges", @out_edges) gen.close() return gen.to_s end |