Exception: Mongoid::Shell::Errors::Base

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mongoid/shell/errors/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#problemObject (readonly)

Problem occurred.



6
7
8
# File 'lib/mongoid/shell/errors/base.rb', line 6

def problem
  @problem
end

#resolutionObject (readonly)

Suggested problem resolution.



12
13
14
# File 'lib/mongoid/shell/errors/base.rb', line 12

def resolution
  @resolution
end

#summaryObject (readonly)

Summary of the problem.



9
10
11
# File 'lib/mongoid/shell/errors/base.rb', line 9

def summary
  @summary
end

Instance Method Details

#compose_message(key, attributes = {}) ⇒ Object

Compose the message.

Parameters

key

Lookup key in the translation table.

attributes

The objects to pass to create the message.



18
19
20
21
22
23
24
25
26
# File 'lib/mongoid/shell/errors/base.rb', line 18

def compose_message(key, attributes = {})
  @problem = create_problem(key, attributes)
  @summary = create_summary(key, attributes)
  @resolution = create_resolution(key, attributes)

  "\nProblem:\n  #{@problem}" \
  "\nSummary:\n  #{@summary}" \
  "\nResolution:\n  #{@resolution}"
end