Class: Twitter::List

Inherits:
Identity show all
Includes:
Creatable
Defined in:
lib/twitter/list.rb

Overview

Represents a Twitter list

Instance Attribute Summary collapse

Attributes inherited from Identity

#id

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods included from Creatable

#created?, #created_at

Methods inherited from Identity

#initialize

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

flat_pmap, pmap

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

#descriptionString (readonly)

The slug of this list

Examples:

list.slug

Returns:

  • (String)


58
59
60
# File 'lib/twitter/list.rb', line 58

def description
  @description
end

#full_nameString (readonly)

The slug of this list

Examples:

list.slug

Returns:

  • (String)


58
59
60
# File 'lib/twitter/list.rb', line 58

def full_name
  @full_name
end

#member_countInteger (readonly)

The number of subscribers to this list

Examples:

list.subscriber_count

Returns:

  • (Integer)


22
23
24
# File 'lib/twitter/list.rb', line 22

def member_count
  @member_count
end

#modeString (readonly)

The slug of this list

Examples:

list.slug

Returns:

  • (String)


58
59
60
# File 'lib/twitter/list.rb', line 58

def mode
  @mode
end

#nameString (readonly)

The slug of this list

Examples:

list.slug

Returns:

  • (String)


58
59
60
# File 'lib/twitter/list.rb', line 58

def name
  @name
end

#slugString (readonly)

The slug of this list

Examples:

list.slug

Returns:

  • (String)


58
59
60
# File 'lib/twitter/list.rb', line 58

def slug
  @slug
end

#subscriber_countInteger (readonly)

The number of subscribers to this list

Examples:

list.subscriber_count

Returns:

  • (Integer)


22
23
24
# File 'lib/twitter/list.rb', line 22

def subscriber_count
  @subscriber_count
end

Instance Method Details

#members_uriURI::Generic Also known as: members_url

Returns the URI to the list members

Examples:

list.members_uri

Returns:

  • (URI::Generic)


69
70
71
# File 'lib/twitter/list.rb', line 69

def members_uri
  URI.parse("#{uri}/members") if uri?
end

#subscribers_uriURI::Generic Also known as: subscribers_url

Returns the URI to the list subscribers

Examples:

list.subscribers_uri

Returns:

  • (URI::Generic)


88
89
90
# File 'lib/twitter/list.rb', line 88

def subscribers_uri
  URI.parse("#{uri}/subscribers") if uri?
end

#uriURI::Generic Also known as: url

Returns the URI to the list

Examples:

list.uri

Returns:

  • (URI::Generic)


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

Examples:

list.uri?

Returns:

  • (Boolean)


126
127
128
# File 'lib/twitter/list.rb', line 126

def uri?
  !!uri
end