Sha256: 0559c4454891ac5d2cbb814e217cce5381ddc88b0b134443426988f7023c0fc7

Contents?: true

Size: 1016 Bytes

Versions: 7

Compression:

Stored size: 1016 Bytes

Contents

require 'twitter/base'
require 'twitter/creatable'
require 'twitter/list'
require 'twitter/user'

module Twitter
  module Action
    class ListMemberAdded < Twitter::Base
      include Twitter::Creatable
      attr_reader :max_position, :min_position

      # A collection of users who added a user to a list
      #
      # @return [Array<Twitter::User>]
      def sources
        @sources = Array(@attrs[:sources]).map do |user|
          Twitter::User.fetch_or_new(user)
        end
      end

      # A collection of lists that were added to
      #
      # @return [Array<Twitter::List>]
      def target_objects
        @target_objects = Array(@attrs[:target_objects]).map do |list|
          Twitter::List.fetch_or_new(list)
        end
      end

      # A collection of users who were added to a list
      #
      # @return [Array<Twitter::User>]
      def targets
        @targets = Array(@attrs[:targets]).map do |user|
          Twitter::User.fetch_or_new(user)
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twitter-4.4.0 lib/twitter/action/list_member_added.rb
twitter-4.3.0 lib/twitter/action/list_member_added.rb
twitter-4.2.0 lib/twitter/action/list_member_added.rb
twitter-4.1.2 lib/twitter/action/list_member_added.rb
twitter-4.1.1 lib/twitter/action/list_member_added.rb
twitter-4.1.0 lib/twitter/action/list_member_added.rb
twitter-4.0.0 lib/twitter/action/list_member_added.rb