Class: Appwrite::File
- Inherits:
-
Object
- Object
- Appwrite::File
- Defined in:
- lib/appwrite/file.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, content) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(path, content) ⇒ File
Returns a new instance of File.
10 11 12 13 14 15 |
# File 'lib/appwrite/file.rb', line 10 def initialize(path, content) @path = path @content = content @name = ::File.basename(path) @mime_type = MIME::Types.type_for(path) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/appwrite/file.rb', line 7 def content @content end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
8 9 10 |
# File 'lib/appwrite/file.rb', line 8 def mime_type @mime_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/appwrite/file.rb', line 6 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/appwrite/file.rb', line 5 def path @path end |