Class: Twitter::List
- Includes:
- Creatable
- Defined in:
- lib/twitter/list.rb
Overview
Represents a Twitter list
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The slug of this list.
-
#full_name ⇒ String
readonly
The slug of this list.
-
#member_count ⇒ Integer
readonly
The number of subscribers to this list.
-
#mode ⇒ String
readonly
The slug of this list.
-
#name ⇒ String
readonly
The slug of this list.
-
#slug ⇒ String
readonly
The slug of this list.
-
#subscriber_count ⇒ Integer
readonly
The number of subscribers to this list.
Attributes inherited from Identity
Attributes inherited from Base
Instance Method Summary collapse
-
#members_uri ⇒ URI::Generic
(also: #members_url)
Returns the URI to the list members.
-
#subscribers_uri ⇒ URI::Generic
(also: #subscribers_url)
Returns the URI to the list subscribers.
-
#uri ⇒ URI::Generic
(also: #url)
Returns the URI to the list.
-
#uri? ⇒ Boolean
Returns true if a URI is available for this list.
Methods included from Creatable
Methods inherited from Identity
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader
Methods included from Utils
Constructor Details
This class inherits a constructor from Twitter::Identity
Instance Attribute Details
#description ⇒ String (readonly)
The slug of this list
58 59 60 |
# File 'lib/twitter/list.rb', line 58 def description @description end |
#full_name ⇒ String (readonly)
The slug of this list
58 59 60 |
# File 'lib/twitter/list.rb', line 58 def full_name @full_name end |
#member_count ⇒ Integer (readonly)
The number of subscribers to this list
22 23 24 |
# File 'lib/twitter/list.rb', line 22 def member_count @member_count end |
#mode ⇒ String (readonly)
The slug of this list
58 59 60 |
# File 'lib/twitter/list.rb', line 58 def mode @mode end |
#name ⇒ String (readonly)
The slug of this list
58 59 60 |
# File 'lib/twitter/list.rb', line 58 def name @name end |
#slug ⇒ String (readonly)
The slug of this list
58 59 60 |
# File 'lib/twitter/list.rb', line 58 def slug @slug end |
#subscriber_count ⇒ Integer (readonly)
The number of subscribers to this list
22 23 24 |
# File 'lib/twitter/list.rb', line 22 def subscriber_count @subscriber_count end |
Instance Method Details
#members_uri ⇒ URI::Generic Also known as: members_url
Returns the URI to the list members
69 70 71 |
# File 'lib/twitter/list.rb', line 69 def members_uri URI.parse("#{uri}/members") if uri? end |
#subscribers_uri ⇒ URI::Generic Also known as: subscribers_url
Returns the URI to the list subscribers
88 89 90 |
# File 'lib/twitter/list.rb', line 88 def subscribers_uri URI.parse("#{uri}/subscribers") if uri? end |
#uri ⇒ URI::Generic Also known as: url
Returns the URI to the list
107 108 109 |
# File 'lib/twitter/list.rb', line 107 def uri URI.parse("https://twitter.com/#{user.screen_name}/#{slug}") if slug? && user.screen_name? end |
#uri? ⇒ Boolean
Returns true if a URI is available for this list
126 127 128 |
# File 'lib/twitter/list.rb', line 126 def uri? !!uri end |