Class: Google::Apis::CivicinfoV2::Election
- Inherits:
-
Object
- Object
- Google::Apis::CivicinfoV2::Election
- 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
Information about the election that was queried.
Instance Attribute Summary collapse
-
#election_day ⇒ String
Day of the election in YYYY-MM-DD format.
-
#id ⇒ Fixnum
The unique ID of this election.
-
#name ⇒ String
A displayable name for the election.
-
#ocd_division_id ⇒ String
The political division of the election.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Election
constructor
A new instance of Election.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Election
Returns a new instance of Election.
540 541 542 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 540 def initialize(**args) update!(**args) end |
Instance Attribute Details
#election_day ⇒ String
Day of the election in YYYY-MM-DD format.
Corresponds to the JSON property electionDay
520 521 522 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 520 def election_day @election_day end |
#id ⇒ Fixnum
The unique ID of this election.
Corresponds to the JSON property id
525 526 527 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 525 def id @id end |
#name ⇒ String
A displayable name for the election.
Corresponds to the JSON property name
530 531 532 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 530 def name @name end |
#ocd_division_id ⇒ String
The political division of the election. Represented as an OCD Division ID.
Voters within these political jurisdictions are covered by this election. This
is typically a state such as ocd-division/country:us/state:ca or for the
midterms or general election the entire US (i.e. ocd-division/country:us).
Corresponds to the JSON property ocdDivisionId
538 539 540 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 538 def ocd_division_id @ocd_division_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
545 546 547 548 549 550 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 545 def update!(**args) @election_day = args[:election_day] if args.key?(:election_day) @id = args[:id] if args.key?(:id) @name = args[:name] if args.key?(:name) @ocd_division_id = args[:ocd_division_id] if args.key?(:ocd_division_id) end |