Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/rail-locator-api/api_request.rb
Instance Method Summary collapse
Instance Method Details
#to_params(key) ⇒ Object
364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/rail-locator-api/api_request.rb', line 364 def to_params(key) if self.is_a? ActionDispatch::Http::UploadedFile [key.to_param, File.open(self.path), { :filename => self.original_filename, :content_type => self.content_type } ] elsif %w[File Tempfile StringIO].include?(self.class.name) self else [key.to_param, to_param.to_s] end end |