Class: MyRepresentatives::TAS::CSVUpper

Inherits:
Object
  • Object
show all
Includes:
Fileable, Guessable
Defined in:
lib/my_representatives/tas/csv_upper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Guessable

#guess_first, #guess_gender, #guess_last, #guess_preferred, #guess_title

Methods included from Fileable

#create_tmp

Constructor Details

#initializeCSVUpper

Returns a new instance of CSVUpper.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/my_representatives/tas/csv_upper.rb', line 9

def initialize
  # Tasmania's Parliament website has a word document for their House of Assembly and  Legislative Council.
  # At this time, this gem uses a csv manually created by https://github.com/tennantje/.
  # https://gist.github.com/tennantje/c662bd7a2ac44d2e5839ad73d6d0a80e
  # This gem has opted for this approach given that there is also no scrapable data on the Tasmanian Parliament website,
  # whereas Northern Territory (for example) has no CSV file, but does at least have a scrapable website.
  @csv_url      = "https://gist.githubusercontent.com/tennantje/c662bd7a2ac44d2e5839ad73d6d0a80e/raw"
  @csv_filename = "tmp/csv_tas_upper.csv"
  @people       = []

  csv_from_url
  people_from_csv
end

Instance Attribute Details

#csv_filenameObject

Returns the value of attribute csv_filename.



7
8
9
# File 'lib/my_representatives/tas/csv_upper.rb', line 7

def csv_filename
  @csv_filename
end

#csv_urlObject

Returns the value of attribute csv_url.



7
8
9
# File 'lib/my_representatives/tas/csv_upper.rb', line 7

def csv_url
  @csv_url
end

#peopleObject

Returns the value of attribute people.



7
8
9
# File 'lib/my_representatives/tas/csv_upper.rb', line 7

def people
  @people
end