Module: SerenityNow
- Defined in:
- lib/serenity_now.rb,
lib/serenity_now/version.rb,
lib/serenity_now/serenity_api.rb
Defined Under Namespace
Classes: SerenityAPI
Constant Summary collapse
- VERSION =
"1.1.0"
Class Method Summary collapse
-
.e_info(show_id, episode = '') ⇒ Object
Episode Info.
-
.info(show_id, episodes = false) ⇒ Object
Show Info and Show Info + Episode List.
-
.list(show_id) ⇒ Object
Episode List.
-
.schedule(country = 'US', format24 = false) ⇒ Object
Full Schedule available options: { country: ‘US’, 24_format: ‘1’ }.
-
.search(show_name, detailed = false) ⇒ Object
Search and Detailed Search.
Class Method Details
.e_info(show_id, episode = '') ⇒ Object
Episode Info
34 35 36 |
# File 'lib/serenity_now.rb', line 34 def self.e_info( show_id, episode='' ) @api.e_info(show_id, episode)["show"] rescue nil end |
.info(show_id, episodes = false) ⇒ Object
Show Info and Show Info + Episode List
16 17 18 19 |
# File 'lib/serenity_now.rb', line 16 def self.info( show_id, episodes = false ) results = @api.info(show_id, episodes) episodes ? results["Show"] : results["Showinfo"] rescue nil end |
.list(show_id) ⇒ Object
Episode List
24 25 26 27 28 29 |
# File 'lib/serenity_now.rb', line 24 def self.list( show_id ) results = @api.list(show_id) return unless show = results["Show"] episodes = show.delete("Episodelist") { show: show, seasons: episodes["Season"] } end |
.schedule(country = 'US', format24 = false) ⇒ Object
Full Schedule available options: { country: ‘US’, 24_format: ‘1’ }
42 43 44 |
# File 'lib/serenity_now.rb', line 42 def self.schedule( country = 'US', format24 = false ) @api.schedule(country, format24)["schedule"]["DAY"] rescue nil end |
.search(show_name, detailed = false) ⇒ Object
Search and Detailed Search
9 10 11 |
# File 'lib/serenity_now.rb', line 9 def self.search( show_name, detailed = false ) @api.search(show_name, detailed)["Results"]["show"] rescue [] end |