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

Constructor Details

#initialize(**args) ⇒ Candidate

Returns a new instance of Candidate.



221
222
223
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 221

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. If this is a joint ticket it will indicate the name of the candidate at the top of a ticket followed by a / and that name of candidate at the bottom of the ticket. e.g. "Mitt Romney / Paul Ryan" Corresponds to the JSON property name

Returns:

  • (String)


199
200
201
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 199

def name
  @name
end

#order_on_ballotFixnum

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

Returns:

  • (Fixnum)


204
205
206
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 204

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)


209
210
211
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 209

def party
  @party
end

#phoneString

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

Returns:

  • (String)


214
215
216
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 214

def phone
  @phone
end

#photo_urlString

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

Returns:

  • (String)


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

def photo_url
  @photo_url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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