Class: SingleUseLink

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

Instance Method Summary collapse

Instance Method Details

#create_for_path(path) ⇒ Object


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

def create_for_path(path)
  self.class.create(itemId: itemId, path: path)
end

#expired?Boolean

Returns:

  • (Boolean)

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

def expired?
  DateTime.current > expires
end

#to_paramObject


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

def to_param
  downloadKey
end