2018-01-08 15:28:30 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Common
|
|
|
|
module Provider
|
|
|
|
class Named < Sequencer::Unit::Common::Provider::Attribute
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
def named_provide
|
|
|
|
name.demodulize.underscore.to_sym
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.inherited(base)
|
2020-09-30 09:07:01 +00:00
|
|
|
super
|
|
|
|
|
2018-01-08 15:28:30 +00:00
|
|
|
base.extend(ClassMethods)
|
|
|
|
base.provides(base.named_provide)
|
|
|
|
|
|
|
|
base.extend(Forwardable)
|
|
|
|
end
|
|
|
|
|
|
|
|
def provides
|
|
|
|
self.class.named_provide
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|