Class: Ilovepdf::File
- Inherits:
-
Object
- Object
- Ilovepdf::File
- Defined in:
- lib/ilovepdf/file.rb
Constant Summary collapse
- ROTATION_VALUES =
[0, 90, 180, 270]
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#info ⇒ Object
Returns the value of attribute info.
-
#password ⇒ Object
Returns the value of attribute password.
-
#rotate ⇒ Object
Returns the value of attribute rotate.
-
#server_filename ⇒ Object
Returns the value of attribute server_filename.
Instance Method Summary collapse
- #deleted? ⇒ Boolean
- #file_options ⇒ Object
-
#initialize(server_filename, filename) ⇒ File
constructor
A new instance of File.
- #mark_as_deleted ⇒ Object
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
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/ilovepdf/file.rb', line 3 def filename @filename end |
#info ⇒ Object
Returns the value of attribute info.
3 4 5 |
# File 'lib/ilovepdf/file.rb', line 3 def info @info end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/ilovepdf/file.rb', line 3 def password @password end |
#rotate ⇒ Object
Returns the value of attribute rotate.
4 5 6 |
# File 'lib/ilovepdf/file.rb', line 4 def rotate @rotate end |
#server_filename ⇒ Object
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
33 34 35 |
# File 'lib/ilovepdf/file.rb', line 33 def deleted? @deleted end |
#file_options ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/ilovepdf/file.rb', line 14 def h = { server_filename: self.server_filename, filename: self.filename, rotate: self.rotate } h[:password] = self.password if self.password h end |
#mark_as_deleted ⇒ Object
29 30 31 |
# File 'lib/ilovepdf/file.rb', line 29 def mark_as_deleted @deleted = true end |