Class: DasCatalog::ScreencastData
- Inherits:
-
Object
- Object
- DasCatalog::ScreencastData
- Defined in:
- lib/das_catalog/screencast_data.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
(also: #id)
readonly
Returns the value of attribute link.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
-
#watched ⇒ Object
readonly
Returns the value of attribute watched.
Class Method Summary collapse
Instance Method Summary collapse
- #download_link ⇒ Object
- #downloaded ⇒ Object
- #downloaded? ⇒ Boolean
-
#initialize(link) ⇒ ScreencastData
constructor
A new instance of ScreencastData.
- #initialize_uuid ⇒ Object
- #reset_downloaded ⇒ Object
- #reset_watched ⇒ Object
- #save ⇒ Object
- #watched? ⇒ Boolean
Constructor Details
#initialize(link) ⇒ ScreencastData
Returns a new instance of ScreencastData.
7 8 9 10 |
# File 'lib/das_catalog/screencast_data.rb', line 7 def initialize(link) @link = link initialize_uuid end |
Instance Attribute Details
#link ⇒ Object (readonly) Also known as: id
Returns the value of attribute link.
5 6 7 |
# File 'lib/das_catalog/screencast_data.rb', line 5 def link @link end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/das_catalog/screencast_data.rb', line 5 def uuid @uuid end |
#watched ⇒ Object (readonly)
Returns the value of attribute watched.
5 6 7 |
# File 'lib/das_catalog/screencast_data.rb', line 5 def watched @watched end |
Class Method Details
Instance Method Details
#download_link ⇒ Object
22 23 24 |
# File 'lib/das_catalog/screencast_data.rb', line 22 def download_link "#{link}/download" end |
#downloaded ⇒ Object
26 27 28 |
# File 'lib/das_catalog/screencast_data.rb', line 26 def downloaded @downloaded = true end |
#downloaded? ⇒ Boolean
34 35 36 |
# File 'lib/das_catalog/screencast_data.rb', line 34 def downloaded? @downloaded end |
#initialize_uuid ⇒ Object
12 13 14 |
# File 'lib/das_catalog/screencast_data.rb', line 12 def initialize_uuid @uuid ||= SecureRandom.uuid end |
#reset_downloaded ⇒ Object
30 31 32 |
# File 'lib/das_catalog/screencast_data.rb', line 30 def reset_downloaded @downloaded = false end |
#reset_watched ⇒ Object
42 43 44 |
# File 'lib/das_catalog/screencast_data.rb', line 42 def reset_watched @watched = false end |
#save ⇒ Object
50 51 52 |
# File 'lib/das_catalog/screencast_data.rb', line 50 def save Store.store(self) end |
#watched? ⇒ Boolean
46 47 48 |
# File 'lib/das_catalog/screencast_data.rb', line 46 def watched? @watched end |