Sha256: 89e04392c4b163a045450aa460cc52d1bcd9fa5088b8c5f4ca2924679fe52934

Contents?: true

Size: 561 Bytes

Versions: 9

Compression:

Stored size: 561 Bytes

Contents

module Gnip
  class TwitterComplianceMessage < Gnip::Message
    attr_reader :raw, :object_type, :verb, :object, :actor, :timestamp_ms, :target, :withheld_in_countries

    def initialize params = {}
      @raw = params
      @object_type = params['objectType']
      @actor = params['actor']
      @verb = params['verb']
      @timestamp_ms = params['timestampMs']
      @object = params['object']
    end

    def to_h
      @raw
    end

    def timestamp_ms
      DateTime.parse(@timestamp_ms)
    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.2.4 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.2.3 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.2.2 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.2.1 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.2.0 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.1.3 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.1.2 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.1.1 lib/gnip_api/gnip/twitter_compliance_message.rb
gnip_api-1.1.0 lib/gnip_api/gnip/twitter_compliance_message.rb