Class: ROM::LDAP::DSL Private
- Inherits:
- BasicObject
- Defined in:
- lib/rom/ldap/dsl.rb
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.
Direct Known Subclasses
Instance Attribute Summary collapse
- #picked_relations ⇒ Object readonly private
- #relations ⇒ Object readonly private
- #schema ⇒ Object readonly private
Instance Method Summary collapse
- #call(&block) ⇒ Object private
-
#initialize(schema) ⇒ DSL
constructor
private
A new instance of DSL.
- #respond_to_missing?(name, include_private = false) ⇒ Boolean private
Constructor Details
#initialize(schema) ⇒ DSL
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 DSL.
26 27 28 29 30 |
# File 'lib/rom/ldap/dsl.rb', line 26 def initialize(schema) @schema = schema @relations = schema.respond_to?(:relations) ? schema.relations : EMPTY_HASH @picked_relations = ::Concurrent::Map.new end |
Instance Attribute Details
#picked_relations ⇒ 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.
23 24 25 |
# File 'lib/rom/ldap/dsl.rb', line 23 def picked_relations @picked_relations end |
#relations ⇒ 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.
19 20 21 |
# File 'lib/rom/ldap/dsl.rb', line 19 def relations @relations end |
#schema ⇒ 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.
15 16 17 |
# File 'lib/rom/ldap/dsl.rb', line 15 def schema @schema end |
Instance Method Details
#call(&block) ⇒ Object
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.
33 34 35 36 37 38 39 40 41 |
# File 'lib/rom/ldap/dsl.rb', line 33 def call(&block) result = instance_exec(select_relations(block.parameters), &block) if result.is_a?(::Array) result else [result] end end |
#respond_to_missing?(name, include_private = false) ⇒ 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.
44 45 46 |
# File 'lib/rom/ldap/dsl.rb', line 44 def respond_to_missing?(name, include_private = false) super || schema.key?(name) end |