Exception: Moxml::NotImplementedError

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

Overview

Error raised when a feature is not implemented by an adapter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, feature: nil, adapter: nil) ⇒ NotImplementedError

Returns a new instance of NotImplementedError.



174
175
176
177
178
179
# File 'lib/moxml/error.rb', line 174

def initialize(message = nil, feature: nil, adapter: nil)
  @feature = feature
  @adapter = adapter
  message ||= "Feature not implemented"
  super(message)
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



172
173
174
# File 'lib/moxml/error.rb', line 172

def adapter
  @adapter
end

#featureObject (readonly)

Returns the value of attribute feature.



172
173
174
# File 'lib/moxml/error.rb', line 172

def feature
  @feature
end

Instance Method Details

#to_sObject



181
182
183
184
185
186
187
# File 'lib/moxml/error.rb', line 181

def to_s
  msg = super
  msg += "\n  Feature: #{@feature}" if @feature
  msg += "\n  Adapter: #{@adapter}" if @adapter
  msg += "\n  Hint: This feature may not be supported by the current adapter"
  msg
end