Class: Appwrite::File

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



7
8
9
# File 'lib/appwrite/file.rb', line 7

def content
  @content
end

#mime_typeObject (readonly)

Returns the value of attribute mime_type.



8
9
10
# File 'lib/appwrite/file.rb', line 8

def mime_type
  @mime_type
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/appwrite/file.rb', line 6

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/appwrite/file.rb', line 5

def path
  @path
end