Class: Maseti::Client

Inherits:
Object
  • Object
show all
Includes:
Constants, FileDownloader, WebPageParser
Defined in:
lib/maseti/client.rb

Constant Summary

Constants included from Constants

Maseti::Constants::BASE_URL, Maseti::Constants::COUNTRY_CODE, Maseti::Constants::FILE_TYPE, Maseti::Constants::PAGES, Maseti::Constants::TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileDownloader

#compute_hash_of, #download, #download_all_files

Methods included from WebPageParser

#fetch_page, #fetch_xls_paths_from_pages

Constructor Details

#initialize(model: nil, save_data: false, save_path: '', read_from_save_path: false) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
14
# File 'lib/maseti/client.rb', line 9

def initialize(model: nil, save_data: false, save_path: '', read_from_save_path: false)
  @model = model
  @save_data = save_data
  @save_path = save_path
  @read_from_save_path = read_from_save_path
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/maseti/client.rb', line 7

def model
  @model
end

#read_from_save_pathObject (readonly)

Returns the value of attribute read_from_save_path.



7
8
9
# File 'lib/maseti/client.rb', line 7

def read_from_save_path
  @read_from_save_path
end

#save_dataObject (readonly)

Returns the value of attribute save_data.



7
8
9
# File 'lib/maseti/client.rb', line 7

def save_data
  @save_data
end

#save_pathObject (readonly)

Returns the value of attribute save_path.



7
8
9
# File 'lib/maseti/client.rb', line 7

def save_path
  @save_path
end