Class: Chartify::Factory
- Inherits:
-
Object
- Object
- Chartify::Factory
- Defined in:
- lib/chartify/factory.rb
Class Method Summary collapse
Class Method Details
.build(type, &block) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/chartify/factory.rb', line 11 def self.build(type, &block) raise "type has to be a symbol" unless type.kind_of? Symbol chart = "Chartify::#{type.to_s.camelize}Chart".constantize.new block.call chart chart end |