Exception: Lite::Command::Fault

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lite/command/fault.rb

Direct Known Subclasses

Error, Failure, Invalid, Noop

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(caused_by, thrown_by, reason) ⇒ Fault

Returns a new instance of Fault.



10
11
12
13
14
15
16
# File 'lib/lite/command/fault.rb', line 10

def initialize(caused_by, thrown_by, reason)
  super(reason)

  @caused_by = caused_by
  @thrown_by = thrown_by
  @reason = reason
end

Instance Attribute Details

#caused_byObject (readonly)

Returns the value of attribute caused_by.



8
9
10
# File 'lib/lite/command/fault.rb', line 8

def caused_by
  @caused_by
end

#reasonObject (readonly)

Returns the value of attribute reason.



8
9
10
# File 'lib/lite/command/fault.rb', line 8

def reason
  @reason
end

#thrown_byObject (readonly)

Returns the value of attribute thrown_by.



8
9
10
# File 'lib/lite/command/fault.rb', line 8

def thrown_by
  @thrown_by
end

Instance Method Details

#fault_klassObject



18
19
20
# File 'lib/lite/command/fault.rb', line 18

def fault_klass
  @fault_klass ||= self.class.name.split("::").last
end

#fault_nameObject



22
23
24
# File 'lib/lite/command/fault.rb', line 22

def fault_name
  @fault_name ||= fault_klass.downcase
end