Class: Twterm::List
- Inherits:
-
Object
- Object
- Twterm::List
- Defined in:
- lib/twterm/list.rb
Overview
A Twitter list
Instance Attribute Summary collapse
- #description ⇒ String readonly
- #full_name ⇒ String readonly
-
#id ⇒ Integer
readonly
Unique ID of the list.
-
#member_count ⇒ Integer
readonly
The number of users that are in this list.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
- #name ⇒ String readonly
- #slug ⇒ String readonly
-
#subscriber_count ⇒ Integer
readonly
The number of users that subscribe this list.
- #url ⇒ String readonly
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize(list) ⇒ List
constructor
A new instance of List.
- #update!(list) ⇒ self
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
#description ⇒ String (readonly)
21 22 23 |
# File 'lib/twterm/list.rb', line 21 def description @description end |
#full_name ⇒ String (readonly)
16 17 18 |
# File 'lib/twterm/list.rb', line 16 def full_name @full_name end |
#id ⇒ Integer (readonly)
Unique ID of the list
7 8 9 |
# File 'lib/twterm/list.rb', line 7 def id @id end |
#member_count ⇒ Integer (readonly)
The number of users that are in this list
26 27 28 |
# File 'lib/twterm/list.rb', line 26 def member_count @member_count end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
18 19 20 |
# File 'lib/twterm/list.rb', line 18 def mode @mode end |
#subscriber_count ⇒ Integer (readonly)
The number of users that subscribe this list
31 32 33 |
# File 'lib/twterm/list.rb', line 31 def subscriber_count @subscriber_count end |
Instance Method Details
#==(other) ⇒ 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
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 |