Class: Chem::CDX::CDXBooleanImplied

Inherits:
Object
  • Object
show all
Defined in:
lib/chem/db/cdx.rb

Instance Method Summary collapse

Constructor Details

#initialize(tf) ⇒ CDXBooleanImplied

Returns a new instance of CDXBooleanImplied.



621
622
623
# File 'lib/chem/db/cdx.rb', line 621

def initialize tf
  @bool = tf
end

Instance Method Details

#to_binObject



629
630
631
632
633
634
635
636
# File 'lib/chem/db/cdx.rb', line 629

def to_bin
  if @bool
    str = [1].pack('c')
  else
    str = [0].pack('c')
  end
  ''
end

#to_xmlObject



625
626
627
# File 'lib/chem/db/cdx.rb', line 625

def to_xml
  @bool ? "yes" : "no"
end