Class: Google::Apis::CivicinfoV2::GeographicDivision

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/civicinfo_v2/classes.rb,
generated/google/apis/civicinfo_v2/representations.rb,
generated/google/apis/civicinfo_v2/representations.rb

Overview

Describes a political geography.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GeographicDivision

Returns a new instance of GeographicDivision.



762
763
764
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 762

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#also_known_asArray<String>

Any other valid OCD IDs that refer to the same division. Because OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list. For example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. Corresponds to the JSON property alsoKnownAs

Returns:

  • (Array<String>)


748
749
750
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 748

def also_known_as
  @also_known_as
end

#nameString

The name of the division. Corresponds to the JSON property name

Returns:

  • (String)


753
754
755
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 753

def name
  @name
end

#office_indicesArray<Fixnum>

List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request. Corresponds to the JSON property officeIndices

Returns:

  • (Array<Fixnum>)


760
761
762
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 760

def office_indices
  @office_indices
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



767
768
769
770
771
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 767

def update!(**args)
  @also_known_as = args[:also_known_as] if args.key?(:also_known_as)
  @name = args[:name] if args.key?(:name)
  @office_indices = args[:office_indices] if args.key?(:office_indices)
end