Class: Chem::CDX::Int16

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(num) ⇒ Int16

Returns a new instance of Int16.



980
981
982
# File 'lib/chem/db/cdx.rb', line 980

def initialize num
  @num = num
end

Instance Attribute Details

#numObject (readonly)

Returns the value of attribute num.



979
980
981
# File 'lib/chem/db/cdx.rb', line 979

def num
  @num
end

Instance Method Details

#to_binObject



986
# File 'lib/chem/db/cdx.rb', line 986

def to_bin ; [@num].pack('v') ; end

#to_iObject



987
988
989
# File 'lib/chem/db/cdx.rb', line 987

def to_i
  @num
end

#to_xmlObject



983
984
985
# File 'lib/chem/db/cdx.rb', line 983

def to_xml
  return @num.to_s
end