Sha256: 10c2cfd52456e8eda5070c0a69b5cb5ea8009ef37df010ba04c9bf149155490f

Contents?: true

Size: 508 Bytes

Versions: 29

Compression:

Stored size: 508 Bytes

Contents

module Stitches
  class Error
    attr_reader :code, :message
    def initialize(options = {})
      [:code, :message].each do |key|
        unless options.has_key?(key)
          raise MissingParameter.new(self.class,key)
        end
      end

      @code    = options[:code]
      @message = options[:message]
    end

    class MissingParameter < StandardError
      def initialize(klass,param_name)
        super("#{ klass.name } must be initialized with :#{ param_name }")
      end
    end

  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
stitches-5.0.0 lib/stitches/error.rb
stitches-5.0.0.RC1 lib/stitches/error.rb
stitches-4.2.2 lib/stitches/error.rb
stitches-4.2.1 lib/stitches/error.rb
stitches-4.2.0 lib/stitches/error.rb
stitches-4.2.0.RC3 lib/stitches/error.rb
stitches-4.2.0.RC2 lib/stitches/error.rb
stitches-4.2.0.RC1 lib/stitches/error.rb
stitches-4.0.2 lib/stitches/error.rb
stitches-4.1.0RC2 lib/stitches/error.rb
stitches-4.0.1 lib/stitches/error.rb
stitches-4.0.0 lib/stitches/error.rb
stitches-4.0.0.RC1 lib/stitches/error.rb
stitches-3.8.3 lib/stitches/error.rb
stitches-3.8.2 lib/stitches/error.rb
stitches-3.8.1 lib/stitches/error.rb
stitches-3.8.0 lib/stitches/error.rb
stitches-3.7.3 lib/stitches/error.rb
stitches-3.7.2 lib/stitches/error.rb
stitches-3.7.0 lib/stitches/error.rb