Class: Ilovepdf::File

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

Constant Summary collapse

ROTATION_VALUES =
[0, 90, 180, 270]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_filename, filename) ⇒ File

Returns a new instance of File.



8
9
10
11
12
# File 'lib/ilovepdf/file.rb', line 8

def initialize(server_filename, filename)
  self.server_filename  = server_filename
  self.filename         = filename
  @deleted = false
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



3
4
5
# File 'lib/ilovepdf/file.rb', line 3

def filename
  @filename
end

#infoObject

Returns the value of attribute info.



3
4
5
# File 'lib/ilovepdf/file.rb', line 3

def info
  @info
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/ilovepdf/file.rb', line 3

def password
  @password
end

#rotateObject

Returns the value of attribute rotate.



4
5
6
# File 'lib/ilovepdf/file.rb', line 4

def rotate
  @rotate
end

#server_filenameObject

Returns the value of attribute server_filename.



3
4
5
# File 'lib/ilovepdf/file.rb', line 3

def server_filename
  @server_filename
end

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/ilovepdf/file.rb', line 33

def deleted?
  @deleted
end

#file_optionsObject



14
15
16
17
18
19
20
21
22
# File 'lib/ilovepdf/file.rb', line 14

def file_options
  h = {
    server_filename: self.server_filename,
    filename: self.filename,
    rotate: self.rotate
  }
  h[:password] = self.password if self.password
  h
end

#mark_as_deletedObject



29
30
31
# File 'lib/ilovepdf/file.rb', line 29

def mark_as_deleted
  @deleted = true
end