Class: RPDF::PDFNumeric
- Includes:
- Comparable
- Defined in:
- lib/rpdf/pdfnumeric.rb
Overview
Numeric Object
- PDFRef15 p28
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from PDFObject
#generation_number, #object_number
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(value, document = nil) ⇒ PDFNumeric
constructor
A new instance of PDFNumeric.
- #to_s ⇒ Object
Methods inherited from PDFObject
#indirect?, #invalidate, #invalidated?, #to_pdf, #to_ref
Constructor Details
#initialize(value, document = nil) ⇒ PDFNumeric
Returns a new instance of PDFNumeric.
12 13 14 15 16 |
# File 'lib/rpdf/pdfnumeric.rb', line 12 def initialize(value, document=nil) raise Exception.new("PDFNumeric is not a number") unless value.kind_of?(Numeric) @value = value super(document) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/rpdf/pdfnumeric.rb', line 10 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 |
# File 'lib/rpdf/pdfnumeric.rb', line 18 def <=>(other) @value <=> other.value end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/rpdf/pdfnumeric.rb', line 22 def to_s @value.to_s end |