Class: SimpleType

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

Constant Summary collapse

TTYPE =
1
NAME =
2
FIELDS =
{
  TTYPE => {:type => ::Thrift::Types::I32, :name => 'ttype', :enum_class => TTypeTag},
  NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



37
# File 'lib/thrift/reflection_limited_types.rb', line 37

def struct_fields; FIELDS; end

#validateObject



39
40
41
42
43
# File 'lib/thrift/reflection_limited_types.rb', line 39

def validate
  unless @ttype.nil? || TTypeTag::VALID_VALUES.include?(@ttype)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field ttype!')
  end
end