Method: CF::Line.inspect

Defined in:
lib/cf/line.rb

.inspect(line_title) ⇒ Object

Return all the associated elements of a line

Usage Example:

line = CF::Line.inspect("line_title")


433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/cf/line.rb', line 433

def self.inspect(line_title)
  resp = get("/lines/#{CF.account_name}/#{line_title.downcase}/inspect.json")
  @errors = resp['error']['message'] if resp['code'] != 200
  # if resp['code'] == 200
  #         send_resp = resp.to_hash
  #         # @line_input_formats = []
  #         #        resp.input_formats.each do |l_i|
  #         #          @line_input_formats << l_i.to_hash
  #         #        end
  #         #        send_resp.delete("input_formats")
  #         #        send_resp.merge!("input_formats" => @line_input_formats)
  #         # @stations = []
  #
  #         # resp.stations.each do |s|
  #         #           @station_input_formats = []
  #         #           s.input_formats.each do |i|
  #         #             @station_input_formats << i.to_hash
  #         #           end
  #         #           @station_form_fields = []
  #         #           @temp_station = s.to_hash
  #         #           if !s.form_fields.nil?
  #         #             s.form_fields.each do |f|
  #         #               @station_form_fields << f.to_hash
  #         #             end
  #         #             @temp_station.delete("form_fields")
  #         #             @temp_station.merge!("form_fields" => @station_form_fields)
  #         #           end
  #         #           @temp_station.delete("input_formats")
  #         #           @temp_station.merge!("input_formats" => @station_input_formats)
  #         #           @stations << @temp_station
  #         #         end
  #               #
  #               # send_resp.delete("stations")
  #               # send_resp.merge!("stations" => @stations)
  #         send_resp
  #       else
  return resp
  # end
end