Class: Rubabel::Smarts
Instance Attribute Summary collapse
-
#ob ⇒ Object
Returns the value of attribute ob.
Instance Method Summary collapse
-
#initialize(string) ⇒ Smarts
constructor
A new instance of Smarts.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(string) ⇒ Smarts
Returns a new instance of Smarts.
8 9 10 11 12 13 14 |
# File 'lib/rubabel/smarts.rb', line 8 def initialize(string) @string = string @ob = OpenBabel::OBSmartsPattern.new unless @ob.init(string) raise ArgumentError, "#{string} not a valid SMARTS string" end end |
Instance Attribute Details
#ob ⇒ Object
Returns the value of attribute ob.
6 7 8 |
# File 'lib/rubabel/smarts.rb', line 6 def ob @ob end |
Instance Method Details
#inspect ⇒ Object
23 24 25 |
# File 'lib/rubabel/smarts.rb', line 23 def inspect "<Rubabel::Smarts #{to_s}>" end |
#to_s ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rubabel/smarts.rb', line 16 def to_s # would like to do the above, but just getting this: # #<SWIG::TYPE_p_std__string:0x000000022ecd70 # @obsmarts.get_smarts.to_s @string end |