Sha256: 3d29ce3f48f846e1a11466477b130498292229304cf800cf49ffc56f74f0ef48

Contents?: true

Size: 526 Bytes

Versions: 9

Compression:

Stored size: 526 Bytes

Contents

module Gnip
  class SystemMessage < Gnip::Message
    attr_reader :message, :sent, :message_type

    def initialize params
      @raw = params
      @message_type = params.keys.first
      @message = params['message']
      @sent = params['sent']
    end

    def original_attributes
      {
        @message_type => @message,
        :sent => @sent
      }
    end

    def log_method
      @message_type.to_sym
    end

    def message
      @message.strip
    end
    
    def to_json
      @raw.to_json
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gnip_api-1.1.3 lib/gnip_api/gnip/system_message.rb
gnip_api-1.1.2 lib/gnip_api/gnip/system_message.rb
gnip_api-1.1.1 lib/gnip_api/gnip/system_message.rb
gnip_api-1.1.0 lib/gnip_api/gnip/system_message.rb
gnip_api-1.0.6 lib/gnip_api/gnip/system_message.rb
gnip_api-1.0.5 lib/gnip_api/gnip/system_message.rb
gnip_api-1.0.4 lib/gnip_api/gnip/system_message.rb
gnip_api-1.0.3 lib/gnip_api/gnip/system_message.rb
gnip_api-1.0.2 lib/gnip_api/gnip/system_message.rb