Class: Google::Apis::CivicinfoV2::Candidate

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 candidate running for elected office.

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

Returns a new instance of Candidate.



219
220
221
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 219

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

Instance Attribute Details

#candidate_urlString

The URL for the candidate's campaign web site. Corresponds to the JSON property candidateUrl

Returns:

  • (String)


182
183
184
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 182

def candidate_url
  @candidate_url
end

#channelsArray<Google::Apis::CivicinfoV2::Channel>

A list of known (social) media channels for this candidate. Corresponds to the JSON property channels



187
188
189
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 187

def channels
  @channels
end

#emailString

The email address for the candidate's campaign. Corresponds to the JSON property email

Returns:

  • (String)


192
193
194
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 192

def email
  @email
end

#nameString

The candidate's name. Corresponds to the JSON property name

Returns:

  • (String)


197
198
199
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 197

def name
  @name
end

#order_on_ballotString

The order the candidate appears on the ballot for this contest. Corresponds to the JSON property orderOnBallot

Returns:

  • (String)


202
203
204
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 202

def order_on_ballot
  @order_on_ballot
end

#partyString

The full name of the party the candidate is a member of. Corresponds to the JSON property party

Returns:

  • (String)


207
208
209
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 207

def party
  @party
end

#phoneString

The voice phone number for the candidate's campaign office. Corresponds to the JSON property phone

Returns:

  • (String)


212
213
214
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 212

def phone
  @phone
end

#photo_urlString

A URL for a photo of the candidate. Corresponds to the JSON property photoUrl

Returns:

  • (String)


217
218
219
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 217

def photo_url
  @photo_url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



224
225
226
227
228
229
230
231
232
233
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 224

def update!(**args)
  @candidate_url = args[:candidate_url] if args.key?(:candidate_url)
  @channels = args[:channels] if args.key?(:channels)
  @email = args[:email] if args.key?(:email)
  @name = args[:name] if args.key?(:name)
  @order_on_ballot = args[:order_on_ballot] if args.key?(:order_on_ballot)
  @party = args[:party] if args.key?(:party)
  @phone = args[:phone] if args.key?(:phone)
  @photo_url = args[:photo_url] if args.key?(:photo_url)
end