Class: DasCatalog::ScreencastData

Inherits:
Object
  • Object
show all
Defined in:
lib/das_catalog/screencast_data.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Returns the value of attribute link.



5
6
7
# File 'lib/das_catalog/screencast_data.rb', line 5

def link
  @link
end

#uuidObject (readonly)

Returns the value of attribute uuid.



5
6
7
# File 'lib/das_catalog/screencast_data.rb', line 5

def uuid
  @uuid
end

#watchedObject (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



16
17
18
# File 'lib/das_catalog/screencast_data.rb', line 16

def self.for_link(link)
  Store.find(link) or new(link)
end

Instance Method Details



22
23
24
# File 'lib/das_catalog/screencast_data.rb', line 22

def download_link
  "#{link}/download"
end

#downloadedObject



26
27
28
# File 'lib/das_catalog/screencast_data.rb', line 26

def downloaded
  @downloaded = true
end

#downloaded?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/das_catalog/screencast_data.rb', line 34

def downloaded?
  @downloaded
end

#initialize_uuidObject



12
13
14
# File 'lib/das_catalog/screencast_data.rb', line 12

def initialize_uuid
  @uuid ||= SecureRandom.uuid
end

#reset_downloadedObject



30
31
32
# File 'lib/das_catalog/screencast_data.rb', line 30

def reset_downloaded
  @downloaded = false
end

#reset_watchedObject



42
43
44
# File 'lib/das_catalog/screencast_data.rb', line 42

def reset_watched
  @watched = false
end

#saveObject



50
51
52
# File 'lib/das_catalog/screencast_data.rb', line 50

def save
  Store.store(self)
end

#watched?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/das_catalog/screencast_data.rb', line 46

def watched?
  @watched
end