Sha256: 4434aa67bb362c6b35c0e38d8768d68c8420d30fcbeb41a37fc6d7c64246c3b2

Contents?: true

Size: 804 Bytes

Versions: 2

Compression:

Stored size: 804 Bytes

Contents

module SVGGVS
  module Page
    class Base
      def initialize(options)
        @options = options
      end

      def cards_per_page
        self.class::CARDS_X * self.class::CARDS_Y
      end

      def montage_tiling
        [ self.class::CARDS_X, self.class::CARDS_Y ].join('x')
      end

      private
      def card_width
        card_size.first
      end

      def card_height
        card_size.last
      end

      def page_height
        card_height * cards_per_width
      end

      def page_width
        card_width * cards_per_height
      end

      def card_size
        @card_size ||= @options[:card_size].split('x').collect(&:to_i)
      end
    end
  end
end

require_relative './letter/poker'
require_relative './letter/small_shard'
require_relative './letter/small_square_tile'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
svggvs-0.0.13 lib/svggvs/page/base.rb
svggvs-0.0.12 lib/svggvs/page/base.rb