Module: Protege::ProviderMixin::ClassMethods
- Defined in:
- lib/protege/extensions/provider_mixin.rb
Overview
Class-level DSL provided by the mixin.
Instance Method Summary collapse
-
#id ⇒ Symbol
Return the declared symbolic id.
-
#protege_id(symbol) ⇒ Symbol
Declare the symbolic identifier this provider responds to.
Instance Method Details
#id ⇒ Symbol
Return the declared symbolic id.
116 117 118 119 120 121 |
# File 'lib/protege/extensions/provider_mixin.rb', line 116 def id @protege_id || raise( Protege::ContractViolationError, "#{self} must declare its id with `protege_id :<symbol>` inside the class body" ) end |
#protege_id(symbol) ⇒ Symbol
Declare the symbolic identifier this provider responds to.
Call inside the class body; the configured provider_id references the provider by this symbol.
108 109 110 |
# File 'lib/protege/extensions/provider_mixin.rb', line 108 def protege_id(symbol) @protege_id = symbol end |