Class: Google::Apis::CivicinfoV2::CivicinfoSchemaV2Contest
- Inherits:
-
Object
- Object
- Google::Apis::CivicinfoV2::CivicinfoSchemaV2Contest
- 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 a contest that appears on a voter's ballot.
Instance Attribute Summary collapse
-
#ballot_placement ⇒ Fixnum
A number specifying the position of this contest on the voter's ballot.
-
#ballot_title ⇒ String
The official title on the ballot for this contest, only where available.
-
#candidates ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Candidate>
The candidate choices for this contest.
-
#district ⇒ Google::Apis::CivicinfoV2::CivicinfoSchemaV2ElectoralDistrict
Describes the geographic scope of a contest.
-
#electorate_specifications ⇒ String
A description of any additional eligibility requirements for voting in this contest.
-
#level ⇒ Array<String>
The levels of government of the office for this contest.
-
#number_elected ⇒ Fixnum
The number of candidates that will be elected to office in this contest.
-
#number_voting_for ⇒ Fixnum
The number of candidates that a voter may vote for in this contest.
-
#office ⇒ String
The name of the office for this contest.
-
#primary_parties ⇒ Array<String>
If this is a partisan election, the name of the party/parties it is for.
-
#referendum_ballot_responses ⇒ Array<String>
The set of ballot responses for the referendum.
-
#referendum_brief ⇒ String
Specifies a short summary of the referendum that is typically on the ballot below the title but above the text.
-
#referendum_con_statement ⇒ String
A statement in opposition to the referendum.
-
#referendum_effect_of_abstain ⇒ String
Specifies what effect abstaining (not voting) on the proposition will have (i. e. whether abstaining is considered a vote against it).
-
#referendum_passage_threshold ⇒ String
The threshold of votes that the referendum needs in order to pass, e.g.
-
#referendum_pro_statement ⇒ String
A statement in favor of the referendum.
-
#referendum_subtitle ⇒ String
A brief description of the referendum.
-
#referendum_text ⇒ String
The full text of the referendum.
-
#referendum_title ⇒ String
The title of the referendum (e.g. 'Proposition 42').
-
#referendum_url ⇒ String
A link to the referendum.
-
#roles ⇒ Array<String>
The roles which this office fulfills.
-
#sources ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Source>
A list of sources for this contest.
-
#special ⇒ String
"Yes" or "No" depending on whether this a contest being held outside the normal election cycle.
-
#type ⇒ String
The type of contest.
Instance Method Summary collapse
-
#initialize(**args) ⇒ CivicinfoSchemaV2Contest
constructor
A new instance of CivicinfoSchemaV2Contest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ CivicinfoSchemaV2Contest
Returns a new instance of CivicinfoSchemaV2Contest.
625 626 627 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 625 def initialize(**args) update!(**args) end |
Instance Attribute Details
#ballot_placement ⇒ Fixnum
A number specifying the position of this contest on the voter's ballot.
Corresponds to the JSON property ballotPlacement
486 487 488 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 486 def ballot_placement @ballot_placement end |
#ballot_title ⇒ String
The official title on the ballot for this contest, only where available.
Corresponds to the JSON property ballotTitle
491 492 493 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 491 def ballot_title @ballot_title end |
#candidates ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Candidate>
The candidate choices for this contest.
Corresponds to the JSON property candidates
496 497 498 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 496 def candidates @candidates end |
#district ⇒ Google::Apis::CivicinfoV2::CivicinfoSchemaV2ElectoralDistrict
Describes the geographic scope of a contest.
Corresponds to the JSON property district
501 502 503 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 501 def district @district end |
#electorate_specifications ⇒ String
A description of any additional eligibility requirements for voting in this
contest.
Corresponds to the JSON property electorateSpecifications
507 508 509 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 507 def electorate_specifications @electorate_specifications end |
#level ⇒ Array<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
516 517 518 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 516 def level @level end |
#number_elected ⇒ Fixnum
The number of candidates that will be elected to office in this contest.
Corresponds to the JSON property numberElected
521 522 523 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 521 def number_elected @number_elected end |
#number_voting_for ⇒ Fixnum
The number of candidates that a voter may vote for in this contest.
Corresponds to the JSON property numberVotingFor
526 527 528 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 526 def number_voting_for @number_voting_for end |
#office ⇒ String
The name of the office for this contest.
Corresponds to the JSON property office
531 532 533 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 531 def office @office end |
#primary_parties ⇒ Array<String>
If this is a partisan election, the name of the party/parties it is for.
Corresponds to the JSON property primaryParties
536 537 538 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 536 def primary_parties @primary_parties end |
#referendum_ballot_responses ⇒ Array<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
543 544 545 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 543 def referendum_ballot_responses @referendum_ballot_responses end |
#referendum_brief ⇒ String
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
550 551 552 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 550 def referendum_brief @referendum_brief end |
#referendum_con_statement ⇒ String
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
556 557 558 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 556 def referendum_con_statement @referendum_con_statement end |
#referendum_effect_of_abstain ⇒ String
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
563 564 565 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 563 def referendum_effect_of_abstain @referendum_effect_of_abstain end |
#referendum_passage_threshold ⇒ String
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
569 570 571 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 569 def referendum_passage_threshold @referendum_passage_threshold end |
#referendum_pro_statement ⇒ String
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
575 576 577 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 575 def referendum_pro_statement @referendum_pro_statement end |
#referendum_subtitle ⇒ String
A brief description of the referendum. This field is only populated for
contests of type 'Referendum'.
Corresponds to the JSON property referendumSubtitle
581 582 583 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 581 def referendum_subtitle @referendum_subtitle end |
#referendum_text ⇒ String
The full text of the referendum. This field is only populated for contests of
type 'Referendum'.
Corresponds to the JSON property referendumText
587 588 589 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 587 def referendum_text @referendum_text end |
#referendum_title ⇒ String
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
593 594 595 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 593 def referendum_title @referendum_title end |
#referendum_url ⇒ String
A link to the referendum. This field is only populated for contests of type '
Referendum'.
Corresponds to the JSON property referendumUrl
599 600 601 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 599 def referendum_url @referendum_url end |
#roles ⇒ Array<String>
The roles which this office fulfills.
Corresponds to the JSON property roles
604 605 606 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 604 def roles @roles end |
#sources ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Source>
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
610 611 612 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 610 def sources @sources end |
#special ⇒ String
"Yes" or "No" depending on whether this a contest being held outside the
normal election cycle.
Corresponds to the JSON property special
616 617 618 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 616 def special @special end |
#type ⇒ String
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
623 624 625 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 623 def type @type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 630 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) @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) @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 |