Class: Rebat::Thrift::Query

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/rebat/thrift/rebat_types.rb

Constant Summary collapse

EDGE =
1
QTYPE =
2
FIELDS =
{
  EDGE => {:type => ::Thrift::Types::STRUCT, :name => 'edge', :class => Rebat::Thrift::Edge},
  QTYPE => {:type => ::Thrift::Types::I32, :name => 'qtype', :default =>             0, :optional => true, :enum_class => Rebat::Thrift::QueryType}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



55
# File 'lib/rebat/thrift/rebat_types.rb', line 55

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


57
58
59
60
61
62
# File 'lib/rebat/thrift/rebat_types.rb', line 57

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field edge is unset!') unless @edge
  unless @qtype.nil? || Rebat::Thrift::QueryType::VALID_VALUES.include?(@qtype)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field qtype!')
  end
end