Exception: TwelvedataRuby::Error
- Inherits:
-
StandardError
- Object
- StandardError
- TwelvedataRuby::Error
- Defined in:
- lib/twelvedata_ruby/error.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_MSGS =
{ "EndpointError" => "Endpoint is not valid. %{invalid}", "EndpointNameError" => "`%{invalid}` is not a correct endpoint. Valid values are: `%{valid_names}`", "EndpointParametersKeysError" => "Invalid parameters found: `%{invalid}`. Valid parameters for `%{name}` "\ "endpoint are: `%{parameters}`. Please see: `Twelvedata::Endpoint#parameters` for more details", "EndpointRequiredParametersError" => "Missing values for required parameters: `%{invalid}`. "\ "`%{name}` endpoint required parameters are: `%{required}`.", "ResponseError" => "Encountered an error from the response" }.freeze
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(args = {}) ⇒ Error
Returns a new instance of Error.
17 18 19 20 |
# File 'lib/twelvedata_ruby/error.rb', line 17 def initialize(args={}) @attrs = args[:attrs] || {} super((args[:message] || DEFAULT_MSGS[Utils.demodulize(self.class)]) % @attrs) end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
15 16 17 |
# File 'lib/twelvedata_ruby/error.rb', line 15 def attrs @attrs end |