Class: Implements::Implementation::Registry::Element Private
- Inherits:
-
Object
- Object
- Implements::Implementation::Registry::Element
- Defined in:
- lib/implements/implementation/registry/element.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
An Element in a Registry
Instance Attribute Summary collapse
- #implementation ⇒ Object readonly private
Instance Method Summary collapse
-
#check?(*args) ⇒ Boolean
private
Check the implementation agains the args that would be used to instantiate it.
-
#initialize(registry, implementation, options, check) ⇒ Element
constructor
private
A new instance of Element.
- #match?(selector) ⇒ Boolean private
- #name ⇒ String private
Constructor Details
#initialize(registry, implementation, options, check) ⇒ Element
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Element.
12 13 14 15 16 17 |
# File 'lib/implements/implementation/registry/element.rb', line 12 def initialize(registry, implementation, , check) @registry = registry @implementation = implementation @options = @check = check end |
Instance Attribute Details
#implementation ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/implements/implementation/registry/element.rb', line 18 def implementation @implementation end |
Instance Method Details
#check?(*args) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check the implementation agains the args that would be used to instantiate it.
34 35 36 37 |
# File 'lib/implements/implementation/registry/element.rb', line 34 def check?(*args) return true unless @check @check.call(*args) end |
#match?(selector) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 26 27 |
# File 'lib/implements/implementation/registry/element.rb', line 23 def match?(selector) selector = selector.to_s if selector.kind_of?(Symbol) selector = selector.dasherize if selector.kind_of?(String) groups.map(&:to_s).any? { |group| selector === group } end |
#name ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/implements/implementation/registry/element.rb', line 41 def name groups.first end |