Class: Google::Apis::CivicinfoV2::Contest

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

Information about a contest that appears on a voter's ballot.

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) ⇒ Contest

Returns a new instance of Contest.


419
420
421
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 419

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

Instance Attribute Details

#ballot_placementFixnum

A number specifying the position of this contest on the voter's ballot. Corresponds to the JSON property ballotPlacement

Returns:

  • (Fixnum)

266
267
268
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 266

def ballot_placement
  @ballot_placement
end

#ballot_titleString

The official title on the ballot for this contest, only where available. Corresponds to the JSON property ballotTitle

Returns:

  • (String)

271
272
273
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 271

def ballot_title
  @ballot_title
end

#candidatesArray<Google::Apis::CivicinfoV2::Candidate>

The candidate choices for this contest. Corresponds to the JSON property candidates


276
277
278
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 276

def candidates
  @candidates
end

#districtGoogle::Apis::CivicinfoV2::ElectoralDistrict

Describes the geographic scope of a contest. Corresponds to the JSON property district


281
282
283
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 281

def district
  @district
end

#electorate_specificationsString

A description of any additional eligibility requirements for voting in this contest. Corresponds to the JSON property electorateSpecifications

Returns:

  • (String)

287
288
289
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 287

def electorate_specifications
  @electorate_specifications
end

#idString

An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page. Corresponds to the JSON property id

Returns:

  • (String)

294
295
296
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 294

def id
  @id
end

#levelArray<String>

The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" and " administrative-area-1". Corresponds to the JSON property level

Returns:

  • (Array<String>)

303
304
305
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 303

def level
  @level
end

#number_electedFixnum

The number of candidates that will be elected to office in this contest. Corresponds to the JSON property numberElected

Returns:

  • (Fixnum)

308
309
310
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 308

def number_elected
  @number_elected
end

#number_voting_forFixnum

The number of candidates that a voter may vote for in this contest. Corresponds to the JSON property numberVotingFor

Returns:

  • (Fixnum)

313
314
315
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 313

def number_voting_for
  @number_voting_for
end

#officeString

The name of the office for this contest. Corresponds to the JSON property office

Returns:

  • (String)

318
319
320
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 318

def office
  @office
end

#primary_partiesArray<String>

If this is a partisan election, the name of the party/parties it is for. Corresponds to the JSON property primaryParties

Returns:

  • (Array<String>)

323
324
325
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 323

def primary_parties
  @primary_parties
end

#primary_partyString

[DEPRECATED] If this is a partisan election, the name of the party it is for. This field as deprecated in favor of the array "primaryParties", as contests may contain more than one party. Corresponds to the JSON property primaryParty

Returns:

  • (String)

330
331
332
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 330

def primary_party
  @primary_party
end

#referendum_ballot_responsesArray<String>

The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include "yes" or "no" for referenda. This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumBallotResponses

Returns:

  • (Array<String>)

337
338
339
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 337

def referendum_ballot_responses
  @referendum_ballot_responses
end

#referendum_briefString

Specifies a short summary of the referendum that is typically on the ballot below the title but above the text. This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumBrief

Returns:

  • (String)

344
345
346
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 344

def referendum_brief
  @referendum_brief
end

#referendum_con_statementString

A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumConStatement

Returns:

  • (String)

350
351
352
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 350

def referendum_con_statement
  @referendum_con_statement
end

#referendum_effect_of_abstainString

Specifies what effect abstaining (not voting) on the proposition will have (i. e. whether abstaining is considered a vote against it). This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumEffectOfAbstain

Returns:

  • (String)

357
358
359
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 357

def referendum_effect_of_abstain
  @referendum_effect_of_abstain
end

#referendum_passage_thresholdString

The threshold of votes that the referendum needs in order to pass, e.g. "two- thirds". This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumPassageThreshold

Returns:

  • (String)

363
364
365
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 363

def referendum_passage_threshold
  @referendum_passage_threshold
end

#referendum_pro_statementString

A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumProStatement

Returns:

  • (String)

369
370
371
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 369

def referendum_pro_statement
  @referendum_pro_statement
end

#referendum_subtitleString

A brief description of the referendum. This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumSubtitle

Returns:

  • (String)

375
376
377
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 375

def referendum_subtitle
  @referendum_subtitle
end

#referendum_textString

The full text of the referendum. This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumText

Returns:

  • (String)

381
382
383
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 381

def referendum_text
  @referendum_text
end

#referendum_titleString

The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'. Corresponds to the JSON property referendumTitle

Returns:

  • (String)

387
388
389
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 387

def referendum_title
  @referendum_title
end

#referendum_urlString

A link to the referendum. This field is only populated for contests of type ' Referendum'. Corresponds to the JSON property referendumUrl

Returns:

  • (String)

393
394
395
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 393

def referendum_url
  @referendum_url
end

#rolesArray<String>

The roles which this office fulfills. Corresponds to the JSON property roles

Returns:

  • (Array<String>)

398
399
400
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 398

def roles
  @roles
end

#sourcesArray<Google::Apis::CivicinfoV2::Source>

A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources. Corresponds to the JSON property sources


404
405
406
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 404

def sources
  @sources
end

#specialString

"Yes" or "No" depending on whether this a contest being held outside the normal election cycle. Corresponds to the JSON property special

Returns:

  • (String)

410
411
412
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 410

def special
  @special
end

#typeString

The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'. For Retention contests this will typically be 'Retention'. Corresponds to the JSON property type

Returns:

  • (String)

417
418
419
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 417

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 424

def update!(**args)
  @ballot_placement = args[:ballot_placement] if args.key?(:ballot_placement)
  @ballot_title = args[:ballot_title] if args.key?(:ballot_title)
  @candidates = args[:candidates] if args.key?(:candidates)
  @district = args[:district] if args.key?(:district)
  @electorate_specifications = args[:electorate_specifications] if args.key?(:electorate_specifications)
  @id = args[:id] if args.key?(:id)
  @level = args[:level] if args.key?(:level)
  @number_elected = args[:number_elected] if args.key?(:number_elected)
  @number_voting_for = args[:number_voting_for] if args.key?(:number_voting_for)
  @office = args[:office] if args.key?(:office)
  @primary_parties = args[:primary_parties] if args.key?(:primary_parties)
  @primary_party = args[:primary_party] if args.key?(:primary_party)
  @referendum_ballot_responses = args[:referendum_ballot_responses] if args.key?(:referendum_ballot_responses)
  @referendum_brief = args[:referendum_brief] if args.key?(:referendum_brief)
  @referendum_con_statement = args[:referendum_con_statement] if args.key?(:referendum_con_statement)
  @referendum_effect_of_abstain = args[:referendum_effect_of_abstain] if args.key?(:referendum_effect_of_abstain)
  @referendum_passage_threshold = args[:referendum_passage_threshold] if args.key?(:referendum_passage_threshold)
  @referendum_pro_statement = args[:referendum_pro_statement] if args.key?(:referendum_pro_statement)
  @referendum_subtitle = args[:referendum_subtitle] if args.key?(:referendum_subtitle)
  @referendum_text = args[:referendum_text] if args.key?(:referendum_text)
  @referendum_title = args[:referendum_title] if args.key?(:referendum_title)
  @referendum_url = args[:referendum_url] if args.key?(:referendum_url)
  @roles = args[:roles] if args.key?(:roles)
  @sources = args[:sources] if args.key?(:sources)
  @special = args[:special] if args.key?(:special)
  @type = args[:type] if args.key?(:type)
end