Class: Redmine::CsvBaseService

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/app/redmine/csv_base_service.rb

Constant Summary collapse

API_LOCATION =
"https://redmine.renuo.ch"

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ CsvBaseService

Returns a new instance of CsvBaseService.



9
10
11
# File 'lib/renuo/cli/app/redmine/csv_base_service.rb', line 9

def initialize(token)
  @token = token
end

Instance Method Details

#getObject



13
14
15
16
17
18
# File 'lib/renuo/cli/app/redmine/csv_base_service.rb', line 13

def get
  http_response = http_request(generate_url)
  encoded_body = http_response.body.force_encoding("ISO-8859-1").encode("UTF-8")
  csv = parse_csv(encoded_body)
  parse_results(csv)
end