Sha256: fe245cc854270d359a20eabb5c896fabf16ad89a1fc2224bc819f16534647cdd

Contents?: true

Size: 522 Bytes

Versions: 39

Compression:

Stored size: 522 Bytes

Contents

module Mspire
  class Spectrum
    # this module can be used to extend the behavior of some peaks as desired
    module Centroidish
      def mz() first end
      def intensity() last end
    end
    # an Array implementation of Centroidish using alias_method.  Accessing
    # :mz and :intensity using this object will be nearly 2X as fast as
    # extending the Centroidish behavior (confirmed by testing)
    class Centroid < Array
      alias_method :mz, :first
      alias_method :intensity, :last
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
mspire-0.10.8.0 lib/mspire/spectrum/centroid.rb
mspire-0.10.7.3 lib/mspire/spectrum/centroid.rb
mspire-0.10.7.2 lib/mspire/spectrum/centroid.rb
mspire-0.10.7.1 lib/mspire/spectrum/centroid.rb
mspire-0.10.7 lib/mspire/spectrum/centroid.rb
mspire-0.10.6 lib/mspire/spectrum/centroid.rb
mspire-0.10.5 lib/mspire/spectrum/centroid.rb
mspire-0.10.4 lib/mspire/spectrum/centroid.rb
mspire-0.10.3 lib/mspire/spectrum/centroid.rb
mspire-0.10.2 lib/mspire/spectrum/centroid.rb
mspire-0.10.1 lib/mspire/spectrum/centroid.rb
mspire-0.10.0 lib/mspire/spectrum/centroid.rb
mspire-0.9.2 lib/mspire/spectrum/centroid.rb
mspire-0.9.1 lib/mspire/spectrum/centroid.rb
mspire-0.9.0 lib/mspire/spectrum/centroid.rb
mspire-0.8.7 lib/mspire/spectrum/centroid.rb
mspire-0.8.6.2 lib/mspire/spectrum/centroid.rb
mspire-0.8.6.1 lib/mspire/spectrum/centroid.rb
mspire-0.8.6 lib/mspire/spectrum/centroid.rb
mspire-0.8.5 lib/mspire/spectrum/centroid.rb