Class: XMLTV::TrivialGrabber
- Defined in:
- lib/xmltv/sites/trivial.rb
Constant Summary
Constants inherited from Grabber
Grabber::Dag, Grabber::MythTV, Grabber::Vandaag
Instance Attribute Summary
Attributes inherited from Grabber
#all_channels, #base_url, #channel_list, #chnbasedir, #config, #config_file_name, #generator, #lang, #myname, #reject_file_name, #spooldir
Instance Method Summary collapse
-
#fetch_all_channels ⇒ Object
Must implement fetch_all_channels or define channel_list as nil Must return something that respond_to? [].
-
#grab_channel(chan_id) ⇒ Object
grab_channel returns number of programs found.
-
#transform(chan_id) ⇒ Object
transform returns an array of special hashes (obtained with proghash).
Methods inherited from Grabber
#add_channels_to_config, #cachefile, #channel_display, #channel_name, #check_argv, #check_channel, #clean_cache_dir, #clean_spool_dir, #config_channels, #date_stats, #delete_channels_from_config, #do_list, #do_options, #dump, #fetch, #fix_times, #get_channels, #initialize, #list_all, #list_config, #load_cachefile, #load_channel_file, #load_config_file, #outputfile, #printline, #proghash, #reject, #report, #run, #save, #save_config, #save_object, #version
Constructor Details
This class inherits a constructor from XMLTV::Grabber
Instance Method Details
#fetch_all_channels ⇒ Object
Must implement fetch_all_channels or define channel_list as nil Must return something that respond_to? []
11 12 13 |
# File 'lib/xmltv/sites/trivial.rb', line 11 def fetch_all_channels { "1" => "Channel" } end |
#grab_channel(chan_id) ⇒ Object
grab_channel returns number of programs found
15 16 17 |
# File 'lib/xmltv/sites/trivial.rb', line 15 def grab_channel(chan_id) 1 end |
#transform(chan_id) ⇒ Object
transform returns an array of special hashes (obtained with proghash)
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/xmltv/sites/trivial.rb', line 20 def transform(chan_id) progdata_array = Array.new progdata = proghash({}, chan_id) progdata['start'] = Time.new progdata['stop'] = Time.new + 60 * 60 progdata['title'] = 'Title' progdata_array << progdata progdata_array end |