Class: Chem::CDX::Int16
- Inherits:
-
Object
- Object
- Chem::CDX::Int16
- Defined in:
- lib/chem/db/cdx.rb
Instance Attribute Summary collapse
-
#num ⇒ Object
readonly
Returns the value of attribute num.
Instance Method Summary collapse
-
#initialize(num) ⇒ Int16
constructor
A new instance of Int16.
- #to_bin ⇒ Object
- #to_i ⇒ Object
- #to_xml ⇒ Object
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
#num ⇒ Object (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_bin ⇒ Object
986 |
# File 'lib/chem/db/cdx.rb', line 986 def to_bin ; [@num].pack('v') ; end |
#to_i ⇒ Object
987 988 989 |
# File 'lib/chem/db/cdx.rb', line 987 def to_i @num end |
#to_xml ⇒ Object
983 984 985 |
# File 'lib/chem/db/cdx.rb', line 983 def to_xml return @num.to_s end |