Class: GeocodeFeatureAttributes

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

Constant Summary collapse

ADM0CAP =
1
ADM1CAP =
2
SCALERANK =
3
LABELRANK =
4
NATSCALE =
5
POPULATION =
6
SOCIALLYRELEVANT =
7
NEIGHBORHOODTYPE =
8
URLS =
9
WORLDCITY =
10
FIELDS =
{
  ADM0CAP => {:type => ::Thrift::Types::BOOL, :name => 'adm0cap', :default => false, :optional => true},
  ADM1CAP => {:type => ::Thrift::Types::BOOL, :name => 'adm1cap', :default => false, :optional => true},
  SCALERANK => {:type => ::Thrift::Types::I32, :name => 'scalerank', :default => 20, :optional => true},
  LABELRANK => {:type => ::Thrift::Types::I32, :name => 'labelrank', :default => 0, :optional => true},
  NATSCALE => {:type => ::Thrift::Types::I32, :name => 'natscale', :default => 0, :optional => true},
  POPULATION => {:type => ::Thrift::Types::I32, :name => 'population', :default => 0, :optional => true},
  SOCIALLYRELEVANT => {:type => ::Thrift::Types::BOOL, :name => 'sociallyRelevant', :default => false, :optional => true},
  NEIGHBORHOODTYPE => {:type => ::Thrift::Types::I32, :name => 'neighborhoodType', :optional => true, :enum_class => ::NeighborhoodType},
  URLS => {:type => ::Thrift::Types::LIST, :name => 'urls', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  WORLDCITY => {:type => ::Thrift::Types::BOOL, :name => 'worldcity', :default => false, :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



250
# File 'lib/thrift/geocoder_types.rb', line 250

def struct_fields; FIELDS; end

#validateObject



252
253
254
255
256
# File 'lib/thrift/geocoder_types.rb', line 252

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