Class: Directory
- Inherits:
-
NodeEntityAbstract
- Object
- ActiveRecord::Base
- NodeEntityAbstract
- Directory
- Defined in:
- app/models/directory.rb
Instance Method Summary collapse
- #downloadable? ⇒ Boolean
-
#initialize(*arg) ⇒ Directory
constructor
A new instance of Directory.
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
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 |