Class: P3::TV::EpisodeFile
- Inherits:
-
Object
- Object
- P3::TV::EpisodeFile
- Defined in:
- lib/p3-tv.rb
Instance Attribute Summary collapse
-
#air_date ⇒ Object
Returns the value of attribute air_date.
-
#episode ⇒ Object
Returns the value of attribute episode.
-
#path ⇒ Object
Returns the value of attribute path.
-
#percent_done ⇒ Object
Returns the value of attribute percent_done.
-
#season ⇒ Object
Returns the value of attribute season.
-
#series ⇒ Object
Returns the value of attribute series.
-
#series_id ⇒ Object
Returns the value of attribute series_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
- #type ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#air_date ⇒ Object
Returns the value of attribute air_date.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def air_date @air_date end |
#episode ⇒ Object
Returns the value of attribute episode.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def episode @episode end |
#path ⇒ Object
Returns the value of attribute path.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def path @path end |
#percent_done ⇒ Object
Returns the value of attribute percent_done.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def percent_done @percent_done end |
#season ⇒ Object
Returns the value of attribute season.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def season @season end |
#series ⇒ Object
Returns the value of attribute series.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def series @series end |
#series_id ⇒ Object
Returns the value of attribute series_id.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def series_id @series_id end |
#status ⇒ Object
Returns the value of attribute status.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def status @status end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
238 239 240 |
# File 'lib/p3-tv.rb', line 238 def title @title end |
#type ⇒ Object
241 242 243 244 245 246 247 248 249 |
# File 'lib/p3-tv.rb', line 241 def type unless @type if( @path ) ext = File::extname( @path ) @type = ext unless ext.empty? end end return @type end |
Instance Method Details
#<=>(other) ⇒ Object
269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/p3-tv.rb', line 269 def <=>( other ) if( self.series == other.series ) if( self.season == other.season ) return self.episode <=> other.episode else return self.season <=> other.season end else return self.series <=> other.series end end |
#to_h ⇒ Object
255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/p3-tv.rb', line 255 def to_h return { :series_id => series_id, :series => series, :season => season, :episode => episode, :title => title, :air_date => air_date.to_s, :path => path, :status => status, :percent_done => percent_done, :thumbnail => thumbnail } end |
#to_json(*a) ⇒ Object
251 252 253 |
# File 'lib/p3-tv.rb', line 251 def to_json(*a) return to_h.to_json(*a) end |
#to_s ⇒ Object
281 282 283 |
# File 'lib/p3-tv.rb', line 281 def to_s return to_h.to_s end |