Class: AEMReference::ElementsByRange
- Inherits:
-
MultipleElements
- Object
- Query
- Specifier
- PositionSpecifier
- MultipleElements
- AEMReference::ElementsByRange
- Defined in:
- lib/_aem/aemreference.rb
Constant Summary collapse
- KeyForm =
The start and stop args are con-based relative references to the first and last elements in range. Note that absolute (app-based) references are also acceptable.
AEMReference.pack_enum(KAE::FormRange)
Constants inherited from MultipleElements
MultipleElements::Any, MultipleElements::First, MultipleElements::Last, MultipleElements::Middle
Constants inherited from PositionSpecifier
PositionSpecifier::After, PositionSpecifier::Before, PositionSpecifier::Beginning, PositionSpecifier::End, PositionSpecifier::Next, PositionSpecifier::Previous
Instance Attribute Summary
Attributes inherited from PositionSpecifier
Instance Method Summary collapse
- #_pack_key(codecs) ⇒ Object
- #AEM_resolve(obj) ⇒ Object
-
#initialize(wantcode, container, key) ⇒ ElementsByRange
constructor
A new instance of ElementsByRange.
- #to_s ⇒ Object
Methods inherited from MultipleElements
#any, #by_filter, #by_id, #by_index, #by_name, #by_range, #first, #last, #middle
Methods inherited from PositionSpecifier
#_pack_self, #after, #before, #beginning, #begins_with, #contains, #elements, #end, #ends_with, #eq, #ge, #gt, #is_in, #le, #lt, #ne, #next, #previous, #property, #user_property
Methods inherited from Specifier
#AEM_pack_self, #AEM_root, #AEM_set_desc, #AEM_true_self
Methods inherited from Query
#==, #AEM_comparable, #hash, #inspect
Constructor Details
#initialize(wantcode, container, key) ⇒ ElementsByRange
Returns a new instance of ElementsByRange.
552 553 554 |
# File 'lib/_aem/aemreference.rb', line 552 def initialize(wantcode, container, key) super(wantcode, container.AEM_true_self, key) end |
Instance Method Details
#_pack_key(codecs) ⇒ Object
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/_aem/aemreference.rb', line 560 def _pack_key(codecs) range_selectors = [ [KAE::KeyAERangeStart, @_key[0]], [KAE::KeyAERangeStop, @_key[1]] ].collect do |key, selector| case selector when Specifier # use selector as-is (note: its-based roots aren't appropriate, but this isn't checked for) when String selector = AEMReference::Con.elements(@AEM_want).by_name(selector) else selector = AEMReference::Con.elements(@AEM_want).by_index(selector) end [key, codecs.pack(selector)] end return AEMReference.pack_list_as(KAE::TypeRangeDescriptor, range_selectors) end |
#AEM_resolve(obj) ⇒ Object
578 579 580 |
# File 'lib/_aem/aemreference.rb', line 578 def AEM_resolve(obj) return @_container.AEM_resolve(obj).send(:by_range, *@_key) end |
#to_s ⇒ Object
556 557 558 |
# File 'lib/_aem/aemreference.rb', line 556 def to_s return "#{@_container}.by_range(#{@_key[0].inspect}, #{@_key[1].inspect})" end |