Sha256: a14fef578ac856b4d32648c1686dd1f0c61535978730d7b95c1627f50e1bdc02

Contents?: true

Size: 537 Bytes

Versions: 12

Compression:

Stored size: 537 Bytes

Contents

require 'openbabel'

module Rubabel
  class Smarts
    
    attr_accessor :ob

    def initialize(string)
      @string = string
      @ob = OpenBabel::OBSmartsPattern.new
      unless @ob.init(string)
        raise ArgumentError, "#{string} not a valid SMARTS string"
      end
    end

    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

    def inspect
      "<Rubabel::Smarts #{to_s}>"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubabel-0.4.3 lib/rubabel/smarts.rb
rubabel-0.4.2 lib/rubabel/smarts.rb
rubabel-0.4.1 lib/rubabel/smarts.rb
rubabel-0.4.0 lib/rubabel/smarts.rb
rubabel-0.3.0 lib/rubabel/smarts.rb
rubabel-0.2.2 lib/rubabel/smarts.rb
rubabel-0.2.1 lib/rubabel/smarts.rb
rubabel-0.2.0 lib/rubabel/smarts.rb
rubabel-0.1.6 lib/rubabel/smarts.rb
rubabel-0.1.5 lib/rubabel/smarts.rb
rubabel-0.1.1 lib/rubabel/smarts.rb
rubabel-0.1.0 lib/rubabel/smarts.rb