Draw a card from the deck.

@return Card

@throws UnderflowException
321924
public function draw()
    {
        if ($this->count() == 0) {
            throw new \UnderflowException('No more cards in the deck!');
        }

        $card = array_pop($this->cards);

        $this->cardsDrawn[] = $card;

        return $card;
    }
766844
@Override
    public void draw() {
        if (displayerSettings == null) {
            getView().errorMissingSettings();
        }
        else if (dataSetHandler == null) {
            getView().errorMissingHandler();
        }
        else if (!isDrawn()) {
            try {
                drawn = true;
                getView().showLoading();

                beforeLoad();
                beforeDataSetLookup();
                dataSetHandler.lookupDataSet(new DataSetReadyCallback() {
                    public void callback(DataSet result) {
                        try {
                            dataSet = result;
                            afterLoad();
                            afterDataSetLookup(result);
                            createVisualization();
                            getView().showVisualization();

                            // Set the id of the container panel so that the displayer can be easily located
                            // by testing tools for instance.
                            String id = getDisplayerId();
                            if (!StringUtils.isBlank(id)) {
                                getView().setId(id);
                            }
                            // Draw done
                            afterDraw();
                        } catch (Exception e) {
                            // Give feedback on any initialization error
                            showError(new ClientRuntimeError(e));
                        }
                    }
                    public void notFound() {
                        getView().errorDataSetNotFound(displayerSettings.getDataSetLookup().getDataSetUUID());
                    }

                    @Override
                    public boolean onError(final ClientRuntimeError error) {
                        showError(error);
                        return false;
                    }
                });
            } catch (Exception e) {
                showError(new ClientRuntimeError(e));
            }
        }
    }
1338997
function (card, cb) {

		Card.findOrCreate(card.id, card)
	    .exec(function (err, foundCard){
	      if (err) return cb(err);
	      if (foundCard.lastStripeEvent > card.lastStripeEvent) return cb(null, foundCard);
	      if (foundCard.lastStripeEvent == card.lastStripeEvent) return Card.afterStripeCustomerCardUpdated(foundCard, function(err, card){ return cb(err, card)});
	      Card.update(foundCard.id, card)
	      .exec(function(err, updatedCards){
	      	if (err) return cb(err);
	      	if (!updatedCards) return cb(null, null);
	      	Card.afterStripeCustomerCardUpdated(updatedCards[0], function(err, card){
	      		cb(err, card);
	      	});
	      });
	    });
	}
319873
public function draw($pages)
    {
        if($this->isProcessed())
        {
            throw new LogicException(sprintf('Pdf has alredy been drawed.'));
        }

        $this->processed = true;


        if(is_array($pages))
        {
            $pageCollection = new PageCollection();

            foreach($pages as $page)
            {
                if(!$page instanceof Page)
                {
                    throw new DrawingException(sprintf('Not all elements of passed array are PHPPdf\Core\Node\Page type. One of them is "%s".', get_class($page)));
                }

                $pageCollection->add($page);
            }
        }
        elseif($pages instanceof PageCollection)
        {
            $pageCollection = $pages;
        }
        else
        {
            throw new InvalidArgumentException(sprintf('Argument of draw method must be an array of pages or PageCollection object, "%s" given.', get_class($pages)));
        }

        $pageCollection->format($this);

        $tasks = $pageCollection->getAllDrawingTasks($this);
        $this->invokeTasks($tasks);
    }
1159008
public function exportCardAsRawCard(Card $card)
    {
        $modelSignatures = [];
        foreach ($card->getSignatures() as $cardSignature) {
            $modelSignatures[] = new RawSignature(
                $cardSignature->getSigner(), $cardSignature->getSignature(), $cardSignature->getSnapshot()
            );
        }

        return new RawSignedModel($card->getContentSnapshot(), $modelSignatures);
    }
655555
public ResponseBuilder withStandardCard(String cardTitle, String cardText, Image image) {
        this.card = StandardCard.builder()
                .withText(cardText)
                .withImage(image)
                .withTitle(cardTitle)
                .build();
        return this;
    }
563554
public function getVertexId($id)
    {
        try {
            return $this->getVertexMatch($this->getCallbackId($id));
        }
        catch (UnderflowException $e) {
            throw new OutOfBoundsException('Vertex ' . $id . ' does not exist', 0, $e);
        }
    }
1204980
public function cards($parameters = [])
    {
        $cards = [];

        $parameters = array_merge(['limit' => 24], $parameters);

        $stripeCards = $this->asStripeCustomer()->sources->all(
            ['object' => 'card'] + $parameters
        );

        if (! is_null($stripeCards)) {
            foreach ($stripeCards->data as $card) {
                $cards[] = new Card($this, $card);
            }
        }

        return new Collection($cards);
    }
313748
def create_card
      raise StandardError, 'Cliente null' if @client.nil?
      # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta
      card = PayuLatam::Card.new(@client)
      # hay un metodo card_params que genera el objeto a enviar con los datos correctos
      # se asignan los params correctos para la peticion
      card.params.merge! card_params

      # intento de creacion de tarjeta
      card.create!
      # si todo bien
      if card.success?
        # se llena la variable @card con la instancia de la clase PayuLatam::Card
        @card = card

        # no me acuerdo XD
        @client.remove_cards
        
        # se agrega la tarjeta al array de tarjetas del usuario. Ojo este array esta en memoria no necesariamente
        # es el mismo array de payu
        @client.add_card( card.response )

        # la respuesta de creacion de payu solo incluye el token de la tarjeta, entonces
        # volvemos a consultar la info almacenada en payu para recibier un poco mas de detalle y almacenarlo
        _card = card.load(card.response['token'])
        # se crea un registro de payu_card con la info publica de la tarjeta y el token de payu de la tarjeta
        @current_user.payu_cards.create(token: @card.response['token'], last_4: _card['number'], brand: _card['type'])
      else
        raise StandardError, "Error generando token de tarjeta: #{card.error}"
      end
    end
765547
public function createFooter()
    {
        $this->childNodes->push(new Card\Footer());

        return $this->footer = $this->childNodes->last();
    }
996516
public function execute()
    {
        parent::execute();

        $addValueSvc = new HpsGiftCardService($this->service->servicesConfig());
        if ($this->token != null && ($this->token instanceof HpsTokenData)) {
            if ($this->card == null) {
                $this->card = new HpsGiftCard();
            }
            $this->card->tokenValue = $this->token->tokenValue;
        }
        return $addValueSvc->addValue(
            $this->amount,
            $this->currency,
            $this->card
        );
    }
307303
public function toChannels($channels, $card)
	{
		$card = array_merge(['channel_uids' => $channels], $card);

		$card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS;

		return $this->request->send('POST', "/channels/cards", $card);
	}
327745
public function createHeader()
    {
        $this->childNodes->prepend(new Card\Header());

        return $this->header = $this->childNodes->first();
    }
964951
public function getCard($cardID)
    {
        $tokenContext = new TokenContext("", 'get');
        $token = $this->accessTokenProvider->getToken($tokenContext);

        $responseModel = $this->cardClient->getCard($cardID, (string)$token);
        if ($responseModel instanceof ErrorResponseModel) {
            throw new CardClientException(
                "error response from card service", $responseModel->getCode(), $responseModel->getMessage()
            );
        }

        $card = $this->parseRawCard($responseModel->getRawSignedModel(), $responseModel->isOutdated());

        if (!$this->cardVerifier->verifyCard($card)) {
            throw new CardVerificationException('Validation errors have been detected');
        }

        return $card;
    }
653327
public function renderAction()
    {
        return Html::tag(
            'div',
            $this->encodeAction ? Html::encode($this->action) : $this->action,
            ['class' => 'card-action']
        );
    }
1179979
def background(opts = {})
      range = Args::CardRange.new(opts[:range], deck_size: size)
      draw  = Args::Draw.new(custom_colors).load!(opts, expand_by: size, layout: layout, dpi: dpi)
      range.each { |i| @cards[i].background(draw.color[i]) }
    end
996940
protected function fillCardDetails($card)
    {
        if ($card instanceof StripeCard) {
            $this->card_brand = $card->brand;
            $this->card_last_four = $card->last4;
        } elseif ($card instanceof StripeBankAccount) {
            $this->card_brand = 'Bank Account';
            $this->card_last_four = $card->last4;
        }

        return $this;
    }