Class: Stitches::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/stitches/error.rb

Defined Under Namespace

Classes: MissingParameter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Error

Returns a new instance of Error.



4
5
6
7
8
9
10
11
12
13
# File 'lib/stitches/error.rb', line 4

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/stitches/error.rb', line 3

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/stitches/error.rb', line 3

def message
  @message
end