Class: Appwrite::Models::File
- Inherits:
-
Object
- Object
- Appwrite::Models::File
- Defined in:
- lib/appwrite/models/file.rb
Instance Attribute Summary collapse
-
#bucket_id ⇒ Object
readonly
Returns the value of attribute bucket_id.
-
#chunks_total ⇒ Object
readonly
Returns the value of attribute chunks_total.
-
#chunks_uploaded ⇒ Object
readonly
Returns the value of attribute chunks_uploaded.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#read ⇒ Object
readonly
Returns the value of attribute read.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#size_original ⇒ Object
readonly
Returns the value of attribute size_original.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#write ⇒ Object
readonly
Returns the value of attribute write.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, bucket_id:, created_at:, updated_at:, read:, write:, name:, signature:, mime_type:, size_original:, chunks_total:, chunks_uploaded:) ⇒ File
constructor
A new instance of File.
- #to_map ⇒ Object
Constructor Details
#initialize(id:, bucket_id:, created_at:, updated_at:, read:, write:, name:, signature:, mime_type:, size_original:, chunks_total:, chunks_uploaded:) ⇒ File
Returns a new instance of File.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/appwrite/models/file.rb', line 19 def initialize( id:, bucket_id:, created_at:, updated_at:, read:, write:, name:, signature:, mime_type:, size_original:, chunks_total:, chunks_uploaded: ) @id = id @bucket_id = bucket_id @created_at = created_at @updated_at = updated_at @read = read @write = write @name = name @signature = signature @mime_type = mime_type @size_original = size_original @chunks_total = chunks_total @chunks_uploaded = chunks_uploaded end |
Instance Attribute Details
#bucket_id ⇒ Object (readonly)
Returns the value of attribute bucket_id.
7 8 9 |
# File 'lib/appwrite/models/file.rb', line 7 def bucket_id @bucket_id end |
#chunks_total ⇒ Object (readonly)
Returns the value of attribute chunks_total.
16 17 18 |
# File 'lib/appwrite/models/file.rb', line 16 def chunks_total @chunks_total end |
#chunks_uploaded ⇒ Object (readonly)
Returns the value of attribute chunks_uploaded.
17 18 19 |
# File 'lib/appwrite/models/file.rb', line 17 def chunks_uploaded @chunks_uploaded end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
8 9 10 |
# File 'lib/appwrite/models/file.rb', line 8 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/appwrite/models/file.rb', line 6 def id @id end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
14 15 16 |
# File 'lib/appwrite/models/file.rb', line 14 def mime_type @mime_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/appwrite/models/file.rb', line 12 def name @name end |
#read ⇒ Object (readonly)
Returns the value of attribute read.
10 11 12 |
# File 'lib/appwrite/models/file.rb', line 10 def read @read end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
13 14 15 |
# File 'lib/appwrite/models/file.rb', line 13 def signature @signature end |
#size_original ⇒ Object (readonly)
Returns the value of attribute size_original.
15 16 17 |
# File 'lib/appwrite/models/file.rb', line 15 def size_original @size_original end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/appwrite/models/file.rb', line 9 def updated_at @updated_at end |
#write ⇒ Object (readonly)
Returns the value of attribute write.
11 12 13 |
# File 'lib/appwrite/models/file.rb', line 11 def write @write end |
Class Method Details
.from(map:) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/appwrite/models/file.rb', line 47 def self.from(map:) File.new( id: map["$id"], bucket_id: map["bucketId"], created_at: map["$createdAt"], updated_at: map["$updatedAt"], read: map["$read"], write: map["$write"], name: map["name"], signature: map["signature"], mime_type: map["mimeType"], size_original: map["sizeOriginal"], chunks_total: map["chunksTotal"], chunks_uploaded: map["chunksUploaded"] ) end |
Instance Method Details
#to_map ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/appwrite/models/file.rb', line 64 def to_map { "$id": @id, "bucketId": @bucket_id, "$createdAt": @created_at, "$updatedAt": @updated_at, "$read": @read, "$write": @write, "name": @name, "signature": @signature, "mimeType": @mime_type, "sizeOriginal": @size_original, "chunksTotal": @chunks_total, "chunksUploaded": @chunks_uploaded } end |