Module: RDF::Countable
- Extended by:
- Util::Aliasing::LateBound
- Included in:
- Enumerator, Enumerable, Graph, MergeGraph
- Defined in:
- vendor/bundler/ruby/3.0.0/bundler/gems/rdf-c7ceb71ef751/lib/rdf/mixin/countable.rb,
vendor/bundler/ruby/3.0.0/bundler/gems/rdf-c7ceb71ef751/lib/rdf/mixin/enumerator.rb
Overview
Defined Under Namespace
Classes: Enumerator
Instance Method Summary collapse
-
#count ⇒ Integer
(also: #size)
Returns the number of RDF statements in
self
. -
#empty? ⇒ Boolean
Returns
true
ifself
contains no RDF statements.
Methods included from Util::Aliasing::LateBound
Instance Method Details
#count ⇒ Integer Also known as: size
Returns the number of RDF statements in self
.
21 22 23 24 25 |
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/rdf-c7ceb71ef751/lib/rdf/mixin/countable.rb', line 21 def count count = 0 each { count += 1 } count end |
#empty? ⇒ Boolean
Returns true
if self
contains no RDF statements.
12 13 14 15 |
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/rdf-c7ceb71ef751/lib/rdf/mixin/countable.rb', line 12 def empty? each {return false} true end |