class Tapjoy::LDAP::CLI::Group::Create

Create LDAP group

Public Instance Methods

create() click to toggle source
# File lib/tapjoy/ldap/cli/group/create.rb, line 7
def create
  # Check for errors
  Optimist.die :type, "argument must be 'user' or 'service'" unless ['user', 'service'].include?(opts[:type])

  puts Tapjoy::LDAP::API::Group.create(opts[:name], opts[:type])
end

Private Instance Methods

opts() click to toggle source
# File lib/tapjoy/ldap/cli/group/create.rb, line 14
        def opts
  @opts ||= Optimist.options do
    # Set help message
    usage 'group create [options]'
    synopsis "\nThis command is for creating new LDAP groups"

    opt :name, 'Specify group to create', type: :string, required: true
    opt :type, 'Specfy if this is a user or service group', type: :string, default: 'user'
  end
end