-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
list.rb
29 lines (25 loc) · 802 Bytes
/
list.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'twitter/base'
require 'twitter/user'
module Twitter
class List < Twitter::Base
attr_reader :description, :following, :full_name, :id, :member_count,
:mode, :name, :slug, :subscriber_count, :uri, :user
alias :following? :following
def initialize(list={})
@description = list['description']
@following = list['following']
@full_name = list['full_name']
@id = list['id']
@member_count = list['member_count']
@mode = list['mode']
@name = list['name']
@slug = list['slug']
@subscriber_count = list['subscriber_count']
@uri = list['uri']
@user = Twitter::User.new(list['user']) unless list['user'].nil?
end
def ==(other)
super || (other.class == self.class && other.id == @id)
end
end
end