Class: RDF::Enumerable::Enumerator

Inherits:
Enumerator
  • Object
show all
Includes:
RDF::Enumerable, Queryable
Defined in:
vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/mixin/enumerator.rb

Overview

Extends Enumerator with Queryable and RDF::Enumerable, which is used by #each_statement and Queryable#enum_for

Instance Method Summary collapse

Methods included from RDF::Enumerable

add_entailment, #dump, #each_graph, #each_object, #each_predicate, #each_quad, #each_statement, #each_subject, #each_term, #each_triple, #entail, #enum_graph, #enum_object, #enum_predicate, #enum_quad, #enum_statement, #enum_subject, #enum_term, #enum_triple, #graph_names, #has_graph?, #has_object?, #has_predicate?, #has_quad?, #has_statement?, #has_subject?, #has_term?, #has_triple?, #invalid?, #objects, #predicates, #project_graph, #quads, #respond_to_missing?, #statements, #subjects, #supports?, #terms, #to_h, #to_set, #triples, #valid?, #validate!

Methods included from Util::Aliasing::LateBound

#alias_method

Methods included from Isomorphic

#bijection_to, #isomorphic_with?

Methods included from Countable

#count, #empty?

Methods included from Queryable

#concise_bounded_description, #first, #first_literal, #first_object, #first_predicate, #first_subject, #first_value, #lint, #query, #query_execute, #query_pattern, #query_without_sparql

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#Object (protected)

Deprecated.

use #to_a instead

See Also:



23
24
25
26
27
28
29
30
31
32
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/mixin/enumerator.rb', line 23

def method_missing(name, *args)
  if name == :to_ary
    warn "[DEPRECATION] #{self.class}#to_ary is deprecated, use " \
         "#{self.class}#to_a instead. Called from " \
         "#{Gem.location_of_caller.join(':')}"
    to_a
  else
    super
  end
end

Instance Method Details

#to_aArray

Note:

Make sure returned arrays are also queryable

Returns:



13
14
15
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/mixin/enumerator.rb', line 13

def to_a
  return super.to_a.extend(RDF::Queryable, RDF::Enumerable)
end