Sha256: f71a41535e5b3ac3a3c14f12517ab68a6f154170334adcf0932b0ce1dd3ebea1

Contents?: true

Size: 476 Bytes

Versions: 85

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

class Avo::CardComponent < ViewComponent::Base
  attr_reader :card

  def initialize(card: nil)
    @card = card

    init_card
  end

  def render?
    card.present?
  end

  # Initializing the card byt running the query method.
  # We'll still keep the query block around for compatibility reasons.
  def init_card
    if card.respond_to? :query
      card.query
    elsif card.query_block.present?
      card.compute_result
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
avo-2.53.0 app/components/avo/card_component.rb
avo-2.52.0 app/components/avo/card_component.rb
avo-2.49.0 app/components/avo/card_component.rb
avo-2.48.0 app/components/avo/card_component.rb
avo-2.47.0 app/components/avo/card_component.rb
avo-2.46.0 app/components/avo/card_component.rb
avo-2.45.0 app/components/avo/card_component.rb
avo-2.44.0 app/components/avo/card_component.rb
avo-2.43.0 app/components/avo/card_component.rb
avo-2.42.2 app/components/avo/card_component.rb
avo-2.42.1 app/components/avo/card_component.rb
avo-2.42.0 app/components/avo/card_component.rb
avo-2.41.0 app/components/avo/card_component.rb
avo-2.40.0 app/components/avo/card_component.rb
avo-2.39.0 app/components/avo/card_component.rb
avo-2.38.0 app/components/avo/card_component.rb
avo-2.37.2 app/components/avo/card_component.rb
avo-2.37.1 app/components/avo/card_component.rb
avo-2.37.0 app/components/avo/card_component.rb
avo-2.36.3 app/components/avo/card_component.rb