Sha256: 4b049a8bf1db6b034bcf590b2eba473c065f279983e8902a45f9b72e056658d3
Contents?: true
Size: 607 Bytes
Versions: 5
Compression:
Stored size: 607 Bytes
Contents
module DotGrid module Page class Factory class UnknownPageExeception < Exception; end PAGES = { 'dot_grid' => ::DotGrid::Page::DotGrid, 'planner' => ::DotGrid::Page::Planner, 'grid' => ::DotGrid::Page::Grid, 'horizontal_rule' => ::DotGrid::Page::HorizontalRule, 'checkerboard' => ::DotGrid::Page::Checkerboard } def self.build(page_type, params) raise UnknownPageExeception, "Unknown page type: #{page_type}" unless PAGES[page_type] PAGES[page_type].new(params) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems