Class: RPDF::PDFVersion

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/rpdf/version.rb

Overview

class describing a PDF version. Don’t use this class directly, but use the constants defined in this file.

PDFRef15 p68

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version_string) ⇒ PDFVersion

Returns a new instance of PDFVersion.



11
12
13
# File 'lib/rpdf/version.rb', line 11

def initialize(version_string)
  @value = version_string
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/rpdf/version.rb', line 9

def value
  @value
end

Instance Method Details

#<=>(other_version) ⇒ Object



15
16
17
# File 'lib/rpdf/version.rb', line 15

def <=>(other_version)
  @value <=> other_version.value
end

#to_pdfObject



19
20
21
# File 'lib/rpdf/version.rb', line 19

def to_pdf
  "%PDF-#{@value}\n"
end