Sha256: 78cf8b4b6b06be5c7822ca2a4008dd3982a777d85b8dc7bb64eb31ab9fc60724

Contents?: true

Size: 405 Bytes

Versions: 2

Compression:

Stored size: 405 Bytes

Contents

require "render/errors"

module Render
  class Generator
    attr_accessor :type, :matcher, :algorithm

    def initialize(properties = {})
      properties.symbolize_keys!
      %w(type matcher algorithm).each { |attribute| self.__send__("#{attribute}=", properties[attribute.to_sym]) }
      raise Errors::Generator::MalformedAlgorithm.new(algorithm) if !algorithm.respond_to?(:call)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
render-0.0.4 lib/render/generator.rb
render-0.0.3 lib/render/generator.rb