Module: Excom::Plugins::Sentry::ClassMethods
- Defined in:
- lib/excom/plugins/sentry.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#_sentry_class ⇒ Object
57 58 59 |
# File 'lib/excom/plugins/sentry.rb', line 57 def _sentry_class @_sentry_class ||= "#{name}Sentry" end |
Instance Method Details
#inherited(command_class) ⇒ Object
38 39 40 41 |
# File 'lib/excom/plugins/sentry.rb', line 38 def inherited(command_class) super command_class.sentry_class(_sentry_class) end |
#sentry_class(klass = nil) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/excom/plugins/sentry.rb', line 43 def sentry_class(klass = nil) return self._sentry_class = klass unless klass.nil? if _sentry_class.is_a?(String) return _sentry_class.constantize if _sentry_class.respond_to?(:constantize) names = _sentry_class.split('::'.freeze) names.shift if names.first.empty? names.reduce(Object){ |obj, name| obj.const_get(name) } else _sentry_class end end |