Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Automatically define inquirer methods

  • Loading branch information...
commit a6da19baf82656af118a4ec27e845b46c22a3d7e 1 parent 13df503
@sferik authored
View
3  lib/twitter/base.rb
@@ -12,6 +12,9 @@ def self.attr_reader(*attrs)
define_method attribute do
@attrs[attribute.to_sym]
end
+ define_method "#{attribute}?" do
+ !!@attrs[attribute.to_sym]
+ end
end
end
const_set(:Attributes, mod)
View
1  lib/twitter/basic_user.rb
@@ -3,7 +3,6 @@
module Twitter
class BasicUser < Twitter::Identity
attr_reader :following, :screen_name
- alias following? following
alias handle screen_name
alias username screen_name
alias user_name screen_name
View
1  lib/twitter/list.rb
@@ -7,7 +7,6 @@ class List < Twitter::Identity
include Twitter::Creatable
attr_reader :description, :following, :full_name, :member_count,
:mode, :name, :slug, :subscriber_count, :uri
- alias following? following
# @return [Twitter::User]
def user
View
1  lib/twitter/settings.rb
@@ -6,7 +6,6 @@ class Settings < Twitter::Base
attr_reader :always_use_https, :discoverable_by_email, :geo_enabled,
:language, :protected, :screen_name, :show_all_inline_media, :sleep_time,
:time_zone
- alias protected? protected
# @return [Twitter::Place]
def trend_location
View
7 lib/twitter/source_user.rb
@@ -4,12 +4,5 @@ module Twitter
class SourceUser < Twitter::BasicUser
attr_reader :all_replies, :blocking, :can_dm, :followed_by, :marked_spam,
:notifications_enabled, :want_retweets
- alias all_replies? all_replies
- alias blocking? blocking
- alias can_dm? can_dm
- alias followed_by? followed_by
- alias marked_spam? marked_spam
- alias notifications_enabled? notifications_enabled
- alias want_retweets? want_retweets
end
end
View
1  lib/twitter/target_user.rb
@@ -3,6 +3,5 @@
module Twitter
class TargetUser < Twitter::BasicUser
attr_reader :followed_by
- alias followed_by? followed_by
end
end
View
5 lib/twitter/tweet.rb
@@ -20,12 +20,9 @@ class Tweet < Twitter::Identity
:profile_image_url_https, :repliers, :retweeted, :retweeters, :source,
:text, :to_user, :to_user_id, :to_user_name, :truncated
alias in_reply_to_tweet_id in_reply_to_status_id
- alias favorited? favorited
alias favourited favorited
- alias favourited? favorited
+ alias favourited? favorited?
alias favouriters favoriters
- alias retweeted? retweeted
- alias truncated? truncated
# @return [Boolean]
def entities?
View
13 lib/twitter/user.rb
@@ -18,10 +18,6 @@ class User < Twitter::BasicUser
:profile_sidebar_fill_color, :profile_text_color,
:profile_use_background_image, :protected, :statuses_count, :time_zone,
:url, :utc_offset, :verified
- alias contributors_enabled? contributors_enabled
- alias default_profile? default_profile
- alias default_profile_image? default_profile_image
- alias follow_request_sent? follow_request_sent
alias favorite_count favourites_count
alias favoriters_count favourites_count
alias favorites_count favourites_count
@@ -29,20 +25,13 @@ class User < Twitter::BasicUser
alias favouriters_count favourites_count
alias follower_count followers_count
alias friend_count friends_count
- alias geo_enabled? geo_enabled
- alias is_translator? is_translator
- alias notifications? notifications
- alias profile_background_tile? profile_background_tile
- alias profile_use_background_image? profile_use_background_image
- alias protected? protected
alias status_count statuses_count
alias translator is_translator
- alias translator? is_translator
+ alias translator? is_translator?
alias tweet_count statuses_count
alias tweets_count statuses_count
alias update_count statuses_count
alias updates_count statuses_count
- alias verified? verified
# Return the URL to the user's profile banner image
#
Please sign in to comment.
Something went wrong with that request. Please try again.