class Tapjoy::LDAP::CLI::User::Show

Manipulates data to a format usable by the API structure for user display

Public Instance Methods

show() click to toggle source

Make the API call to show an LDAP user

# File lib/tapjoy/ldap/cli/user/show.rb, line 9
def show
  Tapjoy::LDAP::API::User.show(opts[:username]).each do |entry|
    puts "DN: #{entry.dn}"
    entry.each do |attribute, values|
      puts "   #{attribute}:"
      values.each do |value|
        puts "      --->#{value}"
      end
    end
  end
end

Private Instance Methods

opts() click to toggle source
# File lib/tapjoy/ldap/cli/user/show.rb, line 22
def opts
  @opts ||= Optimist.options do
    # Set help message
    usage "user show [options]"

    opt :username, 'Specify username', type: :string, required: true
  end
end