Class: FileBrowser::Entry
- Inherits:
-
Object
- Object
- FileBrowser::Entry
- Defined in:
- app/models/file_browser/entry.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#ext ⇒ Object
readonly
Returns the value of attribute ext.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #as_json(opts = {}) ⇒ Object
-
#initialize(path) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(path) ⇒ Entry
Returns a new instance of Entry.
9 10 11 12 13 14 |
# File 'app/models/file_browser/entry.rb', line 9 def initialize(path) @path = path @name = get_name @type = get_type @ext = get_ext end |
Instance Attribute Details
#ext ⇒ Object (readonly)
Returns the value of attribute ext.
7 8 9 |
# File 'app/models/file_browser/entry.rb', line 7 def ext @ext end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'app/models/file_browser/entry.rb', line 7 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'app/models/file_browser/entry.rb', line 7 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'app/models/file_browser/entry.rb', line 7 def type @type end |
Instance Method Details
#as_json(opts = {}) ⇒ Object
22 23 24 |
# File 'app/models/file_browser/entry.rb', line 22 def as_json(opts={}) {'name' => name, 'type' => type, 'path' => path, 'ext' => ext} end |