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