Sha256: 400784b5199547976828a3eddef33343611884f7024158053b8d28735b0148d9

Contents?: true

Size: 692 Bytes

Versions: 25

Compression:

Stored size: 692 Bytes

Contents

module Sprout::Executable

  ##
  # A factory to create concrete Executable::Param
  # entities from a set of known types.
  #
  # If an unrecognized Class reference is provided
  # we will instantiate it and ensure that it 
  # responds to the public members of the 
  # Executable::Param interface.
  class ParameterFactory

    class << self

      def create type
        # Didn't want to clobber the stdlib references
        # to these two important data types...
        # But wanted to keep the add_param interface
        # clean and simple.
        return StringParam.new if type == String
        return FileParam.new if type == File
        type.new
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
sprout-1.0.32.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.31.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.29.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.26.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.25.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.24.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.23.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.22.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.20.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.19.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.18.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.17.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.16.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.15.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.14.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.13.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.11.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.9.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.8.pre lib/sprout/executable/parameter_factory.rb
sprout-1.0.5.pre lib/sprout/executable/parameter_factory.rb