Exception: Softlayer::Errors::SoftlayerError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/softlayer/errors/softlayer_error.rb

Direct Known Subclasses

MissingConfigOption, SoapError

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#problemObject (readonly)

Returns the value of attribute problem.



4
5
6
# File 'lib/softlayer/errors/softlayer_error.rb', line 4

def problem
  @problem
end

#resolutionObject (readonly)

Returns the value of attribute resolution.



6
7
8
# File 'lib/softlayer/errors/softlayer_error.rb', line 6

def resolution
  @resolution
end

#summaryObject (readonly)

Returns the value of attribute summary.



5
6
7
# File 'lib/softlayer/errors/softlayer_error.rb', line 5

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.



12
13
14
15
16
17
18
19
20
# File 'lib/softlayer/errors/softlayer_error.rb', line 12

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