Class: ECFS::ProceedingsQuery

Inherits:
Object
  • Object
show all
Includes:
Query, Util
Defined in:
lib/ecfs/proceedings_query.rb

Constant Summary

Constants included from Util

Util::SIGNALS

Instance Attribute Summary

Attributes included from Query

#constraints

Instance Method Summary collapse

Methods included from Util

#format_iso_date, get_footnotes, #iso_date_to_simple_date

Methods included from Query

#eq, #format_constraint, #initialize, #query_string, #url

Instance Method Details

#base_urlObject



45
46
47
# File 'lib/ecfs/proceedings_query.rb', line 45

def base_url
  "http://apps.fcc.gov/ecfs/proceeding_search/execute"
end

#constraints_dictionaryObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ecfs/proceedings_query.rb', line 9

def constraints_dictionary
  {
    "docket_number"  => "name",
    "bureau_code"    => "bureauCode",
    "subject"        => "subject",
    "bureau_id"      => "bureauIdentificationNumber",
    "applicant"      => "applicant",
    "filed_by"       => "filedBy",
    "recent_filings" => "__checkbox_recentFilingsRequired",
    "open_status"    => "openStatus",
    "created_after"  => "created.minDate",
    "created_before" => "created.maxDate",
    "closed_after"   => "closed.minDate",
    "closed_before"  => "closed.maxDate",
    "callsign"       => "callsign",
    "channel"        => "channel",
    "rule_section"   => "ruleSection",
    "page_number"    => "pageNumber",
    "per_page"       => "pageSize"
  }
end

#getObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ecfs/proceedings_query.rb', line 49

def get
  if @constraints["docket_number"]
    # if docket_number is given along with other constraints, the other constraints will be ignored.
    warn "Constraints other than `docket_number` will be ignored." if @constraints.keys.length > 1
    
    return scrape_proceeding_page! unless @typecast_results
    results = ECFS::Proceeding.new(scrape_proceeding_page!)
  else
    return scrape_results_page unless @typecast_results
    results = ECFS::Proceeding::ResultSet.new(scrape_results_page)
  end

  results
end