Class: ECFS::DailyReleasesQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/ecfs/daily_releases_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDailyReleasesQuery

Returns a new instance of DailyReleasesQuery.



13
14
# File 'lib/ecfs/daily_releases_query.rb', line 13

def initialize
end

Instance Attribute Details

#dayObject

Returns the value of attribute day.



9
10
11
# File 'lib/ecfs/daily_releases_query.rb', line 9

def day
  @day
end

#monthObject

Returns the value of attribute month.



10
11
12
# File 'lib/ecfs/daily_releases_query.rb', line 10

def month
  @month
end

#yearObject

Returns the value of attribute year.



11
12
13
# File 'lib/ecfs/daily_releases_query.rb', line 11

def year
  @year
end

Instance Method Details

#getObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/ecfs/daily_releases_query.rb', line 16

def get
  url = "http://transition.fcc.gov/Daily_Releases/Daily_Business/#{@year}/db#{@month}#{@day}/"
  agent = Mechanize.new
  page = agent.get(url)
  
  links = page.search('a')
  links.shift
  
  ECFS::DailyRelease.new(links, url)
end