Class: RPDF::PDFBoolean
- Includes:
- Comparable
- Defined in:
- lib/rpdf/pdfboolean.rb
Overview
Boolean Object: true or false
- PDFRef15 p28
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) ⇒ PDFBoolean
constructor
A new instance of PDFBoolean.
- #to_s ⇒ Object
Methods inherited from PDFObject
#indirect?, #invalidate, #invalidated?, #to_pdf, #to_ref
Constructor Details
#initialize(value, document = nil) ⇒ PDFBoolean
Returns a new instance of PDFBoolean.
12 13 14 15 16 |
# File 'lib/rpdf/pdfboolean.rb', line 12 def initialize(value, document=nil) raise Exception.new("PDFBoolean not true nor false") unless (value.kind_of?(TrueClass) or value.kind_of?(FalseClass)) @value = value super(document) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/rpdf/pdfboolean.rb', line 10 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 |
# File 'lib/rpdf/pdfboolean.rb', line 18 def <=>(other) @value <=> other.value end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/rpdf/pdfboolean.rb', line 22 def to_s @value.to_s end |