Sha256: 9c267510833f16ab6bb381cd2fcbae2891670c72df2908c148f132df782aea33

Contents?: true

Size: 518 Bytes

Versions: 13

Compression:

Stored size: 518 Bytes

Contents

module MS
  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

13 entries across 13 versions & 1 rubygems

Version Path
mspire-0.6.26 lib/ms/spectrum/centroid.rb
mspire-0.6.25 lib/ms/spectrum/centroid.rb
mspire-0.6.24 lib/ms/spectrum/centroid.rb
mspire-0.6.22 lib/ms/spectrum/centroid.rb
mspire-0.6.21 lib/ms/spectrum/centroid.rb
mspire-0.6.20 lib/ms/spectrum/centroid.rb
mspire-0.6.19 lib/ms/spectrum/centroid.rb
mspire-0.6.18 lib/ms/spectrum/centroid.rb
mspire-0.6.12 lib/ms/spectrum/centroid.rb
mspire-0.6.11 lib/ms/spectrum/centroid.rb
mspire-0.6.9 lib/ms/spectrum/centroid.rb
mspire-0.6.7 lib/ms/spectrum/centroid.rb
mspire-0.6.6 lib/ms/spectrum/centroid.rb