Class: GeocodeFeature

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

Constant Summary collapse

CC =
1
GEOMETRY =
2
NAME =
3
DISPLAYNAME =
4
WOETYPE =
5
IDS =
6
NAMES =
7
ATTRIBUTION =
8
TIMEZONES =
9
HIGHLIGHTEDNAME =
11
MATCHEDNAME =
12
SLUG =
13
ID =
14
ATTRIBUTES =
15
LONGID =
16
LONGIDS =
17
PARENTIDS =
18
ROLE =
19
FIELDS =
{
  CC => {:type => ::Thrift::Types::STRING, :name => 'cc'},
  GEOMETRY => {:type => ::Thrift::Types::STRUCT, :name => 'geometry', :class => ::FeatureGeometry},
  NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :optional => true},
  DISPLAYNAME => {:type => ::Thrift::Types::STRING, :name => 'displayName', :optional => true},
  WOETYPE => {:type => ::Thrift::Types::I32, :name => 'woeType', :default =>     0, :optional => true, :enum_class => ::YahooWoeType},
  IDS => {:type => ::Thrift::Types::LIST, :name => 'ids', :element => {:type => ::Thrift::Types::STRUCT, :class => ::FeatureId}, :optional => true},
  NAMES => {:type => ::Thrift::Types::LIST, :name => 'names', :element => {:type => ::Thrift::Types::STRUCT, :class => ::FeatureName}, :optional => true},
  ATTRIBUTION => {:type => ::Thrift::Types::LIST, :name => 'attribution', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  TIMEZONES => {:type => ::Thrift::Types::LIST, :name => 'timezones', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  HIGHLIGHTEDNAME => {:type => ::Thrift::Types::STRING, :name => 'highlightedName', :optional => true},
  MATCHEDNAME => {:type => ::Thrift::Types::STRING, :name => 'matchedName', :optional => true},
  SLUG => {:type => ::Thrift::Types::STRING, :name => 'slug', :optional => true},
  ID => {:type => ::Thrift::Types::STRING, :name => 'id', :optional => true},
  ATTRIBUTES => {:type => ::Thrift::Types::STRUCT, :name => 'attributes', :class => ::GeocodeFeatureAttributes, :optional => true},
  LONGID => {:type => ::Thrift::Types::I64, :name => 'longId', :optional => true},
  LONGIDS => {:type => ::Thrift::Types::LIST, :name => 'longIds', :element => {:type => ::Thrift::Types::I64}, :optional => true},
  PARENTIDS => {:type => ::Thrift::Types::LIST, :name => 'parentIds', :element => {:type => ::Thrift::Types::I64}, :optional => true},
  ROLE => {:type => ::Thrift::Types::I32, :name => 'role', :optional => true, :enum_class => ::YahooWoeType}
}

Instance Method Summary collapse

Methods included from Underscored

included

Instance Method Details

#struct_fieldsObject



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

def struct_fields; FIELDS; end

#validateObject



336
337
338
339
340
341
342
343
# File 'lib/thrift/geocoder_types.rb', line 336

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