Class: Google::Apis::CivicinfoV2::Election

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

Information about the election that was queried.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Election

Returns a new instance of Election.



537
538
539
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 537

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

Instance Attribute Details

#election_dayString

Day of the election in YYYY-MM-DD format. Corresponds to the JSON property electionDay

Returns:

  • (String)


512
513
514
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 512

def election_day
  @election_day
end

#idFixnum

The unique ID of this election. Corresponds to the JSON property id

Returns:

  • (Fixnum)


517
518
519
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 517

def id
  @id
end

#nameString

A displayable name for the election. Corresponds to the JSON property name

Returns:

  • (String)


522
523
524
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 522

def name
  @name
end

#ocd_division_idString

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

Returns:

  • (String)


530
531
532
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 530

def ocd_division_id
  @ocd_division_id
end

#shape_lookup_behaviorString

Corresponds to the JSON property shapeLookupBehavior

Returns:

  • (String)


535
536
537
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 535

def shape_lookup_behavior
  @shape_lookup_behavior
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



542
543
544
545
546
547
548
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 542

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)
  @shape_lookup_behavior = args[:shape_lookup_behavior] if args.key?(:shape_lookup_behavior)
end