Class: Jubatus::Graph::PresetQuery

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/jubatus/graph/types.rb

Constant Summary collapse

TYPE =
TTuple.new(TList.new(TUserDef.new(Query)), TList.new(TUserDef.new(
Query)))

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

check_type, check_types

Constructor Details

#initialize(edge_query, node_query) ⇒ PresetQuery

Returns a new instance of PresetQuery.


83
84
85
86
# File 'lib/jubatus/graph/types.rb', line 83

def initialize(edge_query, node_query)
  @edge_query = edge_query
  @node_query = node_query
end

Instance Attribute Details

#edge_queryObject (readonly)

Returns the value of attribute edge_query


107
108
109
# File 'lib/jubatus/graph/types.rb', line 107

def edge_query
  @edge_query
end

#node_queryObject (readonly)

Returns the value of attribute node_query


107
108
109
# File 'lib/jubatus/graph/types.rb', line 107

def node_query
  @node_query
end

Class Method Details

.from_msgpack(m) ⇒ Object


93
94
95
96
# File 'lib/jubatus/graph/types.rb', line 93

def PresetQuery.from_msgpack(m)
  val = TYPE.from_msgpack(m)
  PresetQuery.new(*val)
end

Instance Method Details

#to_msgpack(out = '') ⇒ Object


88
89
90
91
# File 'lib/jubatus/graph/types.rb', line 88

def to_msgpack(out = '')
  t = [@edge_query, @node_query]
  return TYPE.to_msgpack(t)
end

#to_sObject


98
99
100
101
102
103
104
105
# File 'lib/jubatus/graph/types.rb', line 98

def to_s
  gen = Jubatus::Common::MessageStringGenerator.new
  gen.open("preset_query")
  gen.add("edge_query", @edge_query)
  gen.add("node_query", @node_query)
  gen.close()
  return gen.to_s
end