Class: Google::Apis::CivicinfoV2::ElectoralDistrict

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

Overview

Describes the geographic scope of a contest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ElectoralDistrict

Returns a new instance of ElectoralDistrict.



643
644
645
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 643

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

Instance Attribute Details

#idString

An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id "34" and a scope of stateUpper. Corresponds to the JSON property id

Returns:

  • (String)


628
629
630
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 628

def id
  @id
end

#nameString

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

Returns:

  • (String)


633
634
635
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 633

def name
  @name
end

#scopeString

The geographic scope of this district. If unspecified the district's geography is not known. One of: national, statewide, congressional, stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special Corresponds to the JSON property scope

Returns:

  • (String)


641
642
643
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 641

def scope
  @scope
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



648
649
650
651
652
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 648

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