Module: Syobocalite
- Defined in:
- lib/syobocalite.rb,
lib/syobocalite/program.rb,
lib/syobocalite/version.rb,
lib/syobocalite/db_client.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"1.1.1"
Class Method Summary collapse
-
.search(start_at:, end_at:) ⇒ Array<Program>
Search programs between
start_at
andend_at
. - .user_agent ⇒ String
Class Method Details
.search(start_at:, end_at:) ⇒ Array<Program>
Search programs between start_at
and end_at
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/syobocalite.rb', line 17 def self.search(start_at:, end_at:) xml = fetch(start_at: start_at, end_at: end_at) response = MultiXml.parse(xml) prog_items = response["syobocal"]["ProgItems"]["ProgItem"] programs = prog_items.map { |prog_item| Syobocalite::Program.from_prog_item(prog_item) } programs.select do |program| (start_at...end_at).cover?(program.st_time) end end |
.user_agent ⇒ String
30 31 32 |
# File 'lib/syobocalite.rb', line 30 def self.user_agent "Syobocalite v#{Syobocalite::VERSION} (+https://github.com/sue445/syobocalite)" end |