Class: Addic7ed::ShowList
- Inherits:
-
Object
- Object
- Addic7ed::ShowList
- Defined in:
- lib/addic7ed/show_list.rb
Instance Attribute Summary collapse
-
#raw_name ⇒ Object
readonly
Returns the value of attribute raw_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw_name) ⇒ ShowList
constructor
A new instance of ShowList.
- #url_segment_for ⇒ Object
Constructor Details
#initialize(raw_name) ⇒ ShowList
Returns a new instance of ShowList.
5 6 7 |
# File 'lib/addic7ed/show_list.rb', line 5 def initialize(raw_name) @raw_name = raw_name end |
Instance Attribute Details
#raw_name ⇒ Object (readonly)
Returns the value of attribute raw_name.
3 4 5 |
# File 'lib/addic7ed/show_list.rb', line 3 def raw_name @raw_name end |
Class Method Details
.url_segment_for(raw_name) ⇒ Object
9 10 11 |
# File 'lib/addic7ed/show_list.rb', line 9 def self.url_segment_for(raw_name) new(raw_name).url_segment_for end |
Instance Method Details
#url_segment_for ⇒ Object
13 14 15 16 17 18 |
# File 'lib/addic7ed/show_list.rb', line 13 def url_segment_for shows_matching = shows_matching_exactly shows_matching = shows_matching_without_year if shows_matching.empty? raise ShowNotFound if shows_matching.empty? shows_matching.last.gsub(' ', '_') end |