Class: SingleUseLink

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/single_use_link.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_download(item_id) ⇒ Object



11
12
13
# File 'app/models/single_use_link.rb', line 11

def self.create_download(item_id)
   create_path(item_id, Sufia::Engine.routes.url_helpers.download_path(item_id) )
end

.create_show(item_id) ⇒ Object



7
8
9
# File 'app/models/single_use_link.rb', line 7

def self.create_show(item_id)
   create_path(item_id, Sufia::Engine.routes.url_helpers.generic_file_path(item_id) )     
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'app/models/single_use_link.rb', line 15

def expired?
   now = DateTime.now
   return (now > expires)
end