Class: Junkie::Episode
- Inherits:
-
Object
- Object
- Junkie::Episode
- Defined in:
- lib/junkie/episode.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#found_at ⇒ Object
readonly
Returns the value of attribute found_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#links ⇒ Object
Returns the value of attribute links.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#series ⇒ Object
readonly
Returns the value of attribute series.
-
#status ⇒ Object
Returns the value of attribute status.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(series, links, description = nil) ⇒ Episode
constructor
A new instance of Episode.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(series, links, description = nil) ⇒ Episode
Returns a new instance of Episode.
11 12 13 14 15 16 17 18 19 |
# File 'lib/junkie/episode.rb', line 11 def initialize(series, links, description=nil) @uuid = SecureRandom.uuid @series = series @links = links @found_at = DateTime.now @description = description @status = :found @id = episode_identifier end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/junkie/episode.rb', line 9 def description @description end |
#found_at ⇒ Object (readonly)
Returns the value of attribute found_at.
8 9 10 |
# File 'lib/junkie/episode.rb', line 8 def found_at @found_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/junkie/episode.rb', line 8 def id @id end |
#links ⇒ Object
Returns the value of attribute links.
9 10 11 |
# File 'lib/junkie/episode.rb', line 9 def links @links end |
#pid ⇒ Object
Returns the value of attribute pid.
9 10 11 |
# File 'lib/junkie/episode.rb', line 9 def pid @pid end |
#series ⇒ Object (readonly)
Returns the value of attribute series.
8 9 10 |
# File 'lib/junkie/episode.rb', line 8 def series @series end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/junkie/episode.rb', line 9 def status @status end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
8 9 10 |
# File 'lib/junkie/episode.rb', line 8 def uuid @uuid end |
Instance Method Details
#to_hash ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/junkie/episode.rb', line 25 def to_hash { uuid: @uuid, id: @id, series: @series, links: @links, status: @status, found_at: @found_at, description: @description } end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/junkie/episode.rb', line 21 def to_s "%s (%s)" % [ @series, episode_identifier ] end |