Class: Faraday::Response::CSV

Inherits:
Response::Middleware
  • Object
show all
Defined in:
lib/faraday/response/csv.rb

Instance Method Summary collapse

Constructor Details

#initialize(app = nil, options = {}) ⇒ CSV

Returns a new instance of CSV.



7
8
9
10
# File 'lib/faraday/response/csv.rb', line 7

def initialize(app = nil, options = {})
  super(app)
  @options = options
end

Instance Method Details

#parse(body) ⇒ Object



12
13
14
15
16
# File 'lib/faraday/response/csv.rb', line 12

def parse(body)
  CSV.parse(body, @options)
rescue Object => err
  raise Faraday::Error::ParsingError.new(err)
end