Class: Chem::CDX::CDXBoolean
- Inherits:
-
Object
- Object
- Chem::CDX::CDXBoolean
- Defined in:
- lib/chem/db/cdx.rb
Instance Method Summary collapse
-
#initialize(tf) ⇒ CDXBoolean
constructor
A new instance of CDXBoolean.
- #to_bin ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(tf) ⇒ CDXBoolean
Returns a new instance of CDXBoolean.
601 602 603 |
# File 'lib/chem/db/cdx.rb', line 601 def initialize tf @bool = tf end |
Instance Method Details
#to_bin ⇒ Object
609 610 611 612 613 614 615 616 |
# File 'lib/chem/db/cdx.rb', line 609 def to_bin if @bool str = [1].pack('c') else str = [0].pack('c') end str end |
#to_xml ⇒ Object
605 606 607 |
# File 'lib/chem/db/cdx.rb', line 605 def to_xml @bool ? "yes" : "no" end |