Class: Directory

Inherits:
NodeEntityAbstract show all
Defined in:
app/models/directory.rb

Instance Method Summary collapse

Methods inherited from NodeEntityAbstract

_find, #attributes=, find, #node

Constructor Details

#initialize(*arg) ⇒ Directory

Returns a new instance of Directory.



5
6
7
8
# File 'app/models/directory.rb', line 5

def initialize(*arg)
  super(*arg)
  self.downloadable = true
end

Instance Method Details

#downloadable?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
19
# File 'app/models/directory.rb', line 10

def downloadable?
  return false unless plain_file
  dir = self
  while (dir)
    return false unless dir.downloadable
    dir = dir.parent
    dir = dir && dir.entity
  end
  return true
end