Exception: TwelvedataRuby::EndpointError

Inherits:
Error
  • Object
show all
Defined in:
lib/twelvedata_ruby/error.rb

Constant Summary

Constants inherited from Error

TwelvedataRuby::Error::DEFAULT_MSGS

Instance Attribute Summary

Attributes inherited from Error

#attrs

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ EndpointError

Returns a new instance of EndpointError.



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/twelvedata_ruby/error.rb', line 24

def initialize(**args)
  endpoint = args[:endpoint]
  super(
    attrs: {
      name: endpoint.name,
      invalid: args[:invalid],
      valid_names: endpoint.class.names.join(", "),
      parameters: endpoint&.parameters_keys&.send(:join, ", "),
      required: endpoint&.required_parameters&.send(:join, ", ")
    }
  )
end