class Softlayer::Errors::SoftlayerError
Attributes
problem[R]
resolution[R]
summary[R]
Public Instance Methods
compose_message(key, attributes = {})
click to toggle source
Compose the message.
Parameters¶ ↑
- key
-
Lookup key in the translation table.
- attributes
-
The objects to pass to create the message.
# 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
Private Instance Methods
create_problem(key, attributes)
click to toggle source
create_resolution(key, attributes)
click to toggle source
create_summary(key, attributes)
click to toggle source
translate(key, options)
click to toggle source
Given the key of the specific error and the options hash, translate the message.
Parameters¶ ↑
- key
-
The key of the error in the locales.
- options
-
The objects to pass to create the message.
Returns a localized error message string.
# File lib/softlayer/errors/softlayer_error.rb, line 34 def translate(key, options) ::I18n.translate("#{BASE_KEY}.#{key}", { locale: :en }.merge(options)).strip end