Module: TwitterFriendly::Utils

Included in:
Client
Defined in:
lib/twitter_friendly/utils.rb

Instance Method Summary collapse

Instance Method Details

#authenticating_user?(target) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


8
9
10
11
# File 'lib/twitter_friendly/utils.rb', line 8

def authenticating_user?(target)
  raise NotImplementedError.new("You must implement ##{__method__}.")
  user.id.to_i == user(target).id.to_i
end

#authorized_user?(target) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


13
14
15
16
17
# File 'lib/twitter_friendly/utils.rb', line 13

def authorized_user?(target)
  raise NotImplementedError.new("You must implement ##{__method__}.")
  target_user = user(target)
  !target_user.protected? || friendship?(user.id.to_i, target_user.id.to_i)
end

#uid_or_screen_name?(object) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


3
4
5
6
# File 'lib/twitter_friendly/utils.rb', line 3

def uid_or_screen_name?(object)
  raise NotImplementedError.new("You must implement ##{__method__}.")
  object.kind_of?(String) || object.kind_of?(Integer)
end