Sha256: aebcd9b7d88947df2668257975d7ed44f6743a27592e2af2ef1246d276923641

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

require 'whirled_peas/animator'
require 'whirled_peas/config'
require 'whirled_peas/errors'
require 'whirled_peas/graphics'
require 'whirled_peas/settings'
require 'whirled_peas/utils'
require 'whirled_peas/version'

module WhirledPeas
  class << self
    def configure(&block)
      yield config
    end

    def register_component(name, klass)
      require 'whirled_peas/component'
      Component::Factory.register(name, klass)
    end

    def component(composer, settings, name, &block)
      require 'whirled_peas/component'
      component = Component::Factory.build(name)
      yield component
      component.compose(composer, settings)
    end

    def template(theme_name=nil, &block)
      require 'whirled_peas/graphics/composer'
      Graphics::Composer.build(theme_name, &block)
    end

    def register_theme(name, &block)
      require 'whirled_peas/settings/theme'
      require 'whirled_peas/settings/theme_library'
      theme = Settings::Theme.new
      yield theme
      Settings::ThemeLibrary.add(name, theme)
    end

    def config
      @config ||= Config.new
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
whirled_peas-0.13.0 lib/whirled_peas.rb
whirled_peas-0.12.0 lib/whirled_peas.rb
whirled_peas-0.11.1 lib/whirled_peas.rb
whirled_peas-0.11.0 lib/whirled_peas.rb