Sha256: e2ae39395604ea267b54c76ca2ba96734919ba1525c2a67ec8c5c86369fc7647

Contents?: true

Size: 646 Bytes

Versions: 3

Compression:

Stored size: 646 Bytes

Contents

module Brightbox

  desc "Manages the accounts"
  command [:accounts] do |cmd|

    cmd.desc "Accept invitation to collaborate with account"
    cmd.arg_name "account_id"
    cmd.command [:accept_invite] do |c|
      c.action do |global_options, options, args|
        account_id = args.first

        # Find the collaboration for that account
        collaboration = UserCollaboration.get_for_account(account_id)
        if collaboration
          collaboration.accept
        else
          raise "Couldn't find an invite for account #{account_id}"
        end

        render_table([collaboration], global_options)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brightbox-cli-1.1.0 lib/brightbox-cli/commands/accounts-accept-invite.rb
brightbox-cli-1.0.0 lib/brightbox-cli/commands/accounts-accept-invite.rb
brightbox-cli-1.0.0.rc2 lib/brightbox-cli/commands/accounts-accept-invite.rb