Sha256: 8f61f66fcb53f2113171ad7bfa4b74df4d2f70db1ac893d0288415d510f9bc53

Contents?: true

Size: 458 Bytes

Versions: 31

Compression:

Stored size: 458 Bytes

Contents

module Skylight
  module Messages
    class Base
      module ClassMethods
        attr_accessor :message_id
      end

      def self.inherited(klass)
        klass.class_eval do
          include Beefcake::Message
          extend  ClassMethods
        end

        klass.message_id = (@count ||= 0)
        Messages.set(klass.message_id, klass)
        @count += 1
      end

      def message_id
        self.class.message_id
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
skylight-0.2.7 lib/skylight/messages/base.rb
skylight-0.2.6 lib/skylight/messages/base.rb
skylight-0.2.5 lib/skylight/messages/base.rb
skylight-0.2.4 lib/skylight/messages/base.rb
skylight-0.2.3 lib/skylight/messages/base.rb
skylight-0.2.2 lib/skylight/messages/base.rb
skylight-0.2.1 lib/skylight/messages/base.rb
skylight-0.2.0 lib/skylight/messages/base.rb
skylight-0.2.0.beta.4 lib/skylight/messages/base.rb
skylight-0.2.0.beta.3 lib/skylight/messages/base.rb
skylight-0.2.0.beta.2 lib/skylight/messages/base.rb
skylight-0.2.0.beta.1 lib/skylight/messages/base.rb
skylight-0.1.8 lib/skylight/messages/base.rb
skylight-0.1.7 lib/skylight/messages/base.rb
skylight-0.1.7.alpha1 lib/skylight/messages/base.rb
skylight-0.1.6 lib/skylight/messages/base.rb
skylight-0.1.6.alpha3 lib/skylight/messages/base.rb
skylight-0.1.6.alpha1 lib/skylight/messages/base.rb
skylight-0.1.5 lib/skylight/messages/base.rb
skylight-0.1.5.alpha2 lib/skylight/messages/base.rb