Class: Quiver::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject, type) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/quiver/error.rb', line 5

def initialize(subject, type)
  if type.is_a?(Symbol)
    @type = type
  else
    @type = type.dup.freeze if type
  end

  if subject.is_a?(Symbol)
    @subject = subject
  else
    @subject = subject.dup.freeze if subject
  end
end

Instance Attribute Details

#subjectObject (readonly)

Returns the value of attribute subject.



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

def subject
  @subject
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
22
# File 'lib/quiver/error.rb', line 19

def ==(other)
  type == other.type &&
    subject == other.subject
end