Sha256: a98965ad6d91aa23c84386277ec9131f30155f1d7f3a7a5d686d85da6720c95a
Contents?: true
Size: 1.26 KB
Versions: 3
Compression:
Stored size: 1.26 KB
Contents
# # Handle anything specific to the user # # This class smells of :reek:InstanceVariableAssumption class GithubListerCore class << self # # Everything below here is private # private def authed_user_in_array(users, authed) users.select { |user| user.downcase == authed.login.downcase } != [] end def process_user_list(user_list, authed) user_list = convert_to_array(user_list) return user_list unless authed if authed_user_in_array(user_list, authed) user_list.delete_if { |user| user.downcase == authed.login.downcase } user_list.append(authed) end user_list end # # Users can be a string (comma separated) or an array nothing else # def get_user_list(client, options) user_list = get_option(options, [:user, :username]) authed = client.user if client.user_authenticated? return convert_to_array(authed) unless user_list case user_list when Array, String process_user_list(user_list, authed) else raise InvalidParameterError.new end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
github-lister-core-0.1.2 | lib/github-lister-core/users.rb |
github-lister-core-0.1.1 | lib/github-lister-core/users.rb |
github-lister-core-0.1.0 | lib/github-lister-core/users.rb |