Class: Twterm::List

Inherits:
Object
  • Object
show all
Defined in:
lib/twterm/list.rb

Overview

A Twitter list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ List

Returns a new instance of List.



43
44
45
46
# File 'lib/twterm/list.rb', line 43

def initialize(list)
  @id = list.id
  update!(list)
end

Instance Attribute Details

#descriptionString (readonly)

Returns:



21
22
23
# File 'lib/twterm/list.rb', line 21

def description
  @description
end

#full_nameString (readonly)

Returns:



16
17
18
# File 'lib/twterm/list.rb', line 16

def full_name
  @full_name
end

#idInteger (readonly)

Unique ID of the list

Returns:

  • (Integer)


7
8
9
# File 'lib/twterm/list.rb', line 7

def id
  @id
end

#member_countInteger (readonly)

The number of users that are in this list

Returns:

  • (Integer)


26
27
28
# File 'lib/twterm/list.rb', line 26

def member_count
  @member_count
end

#modeObject (readonly)

Returns the value of attribute mode.



18
19
20
# File 'lib/twterm/list.rb', line 18

def mode
  @mode
end

#nameString (readonly)

Returns:



10
11
12
# File 'lib/twterm/list.rb', line 10

def name
  @name
end

#slugString (readonly)

Returns:



13
14
15
# File 'lib/twterm/list.rb', line 13

def slug
  @slug
end

#subscriber_countInteger (readonly)

The number of users that subscribe this list

Returns:

  • (Integer)


31
32
33
# File 'lib/twterm/list.rb', line 31

def subscriber_count
  @subscriber_count
end

#urlString (readonly)

Returns:



34
35
36
# File 'lib/twterm/list.rb', line 34

def url
  @url
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


39
40
41
# File 'lib/twterm/list.rb', line 39

def ==(other)
  other.is_a?(self.class) && id == other.id
end

#update!(list) ⇒ self

Returns:

  • (self)


49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/twterm/list.rb', line 49

def update!(list)
  @name = list.name
  @slug = list.slug
  @full_name = list.full_name
  @mode = list.mode
  @description = list.description.is_a?(Twitter::NullObject) ? '' : list.description
  @member_count = list.member_count
  @subscriber_count = list.subscriber_count
  @url = list.url

  self
end