Sha256: 51d5907c6f9a911113374dbcf6d19510c2977722f725034129e90ab2a4e83737

Contents?: true

Size: 467 Bytes

Versions: 3

Compression:

Stored size: 467 Bytes

Contents

module Troo
  class CardPresenter
    class << self
      def show(card, options = {})
        new(card, options).show
      end
    end

    include DecoratorHelpers

    def initialize(card, options = {})
      @card    = card
      @options = options
    end

    def show
      print Template.parse(decorated_card, "/../views/card.erb")
    end

    private
    attr_reader :card

    def decorated_card
      @decorated_card ||= card.decorator
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.7 lib/troo/display/card_presenter.rb
troo-0.0.6 lib/troo/display/card_presenter.rb
troo-0.0.5 lib/troo/display/card_presenter.rb