Module: RDF::Countable

Extended by:
Util::Aliasing::LateBound
Included in:
Enumerator, Enumerable, Graph, MergeGraph
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/mixin/countable.rb

Overview

Since:

  • 0.2.0

Defined Under Namespace

Classes: Enumerator

Instance Method Summary collapse

Methods included from Util::Aliasing::LateBound

alias_method

Instance Method Details

#countInteger Also known as: size

Returns the number of RDF statements in self.

Returns:

Since:

  • 0.2.0



25
26
27
28
29
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/mixin/countable.rb', line 25

def count
  count = 0
  each { count += 1 }
  count
end

#empty?Boolean

Returns true if self contains no RDF statements.

Returns:

  • (Boolean)

Since:

  • 0.2.0



16
17
18
19
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-884e3ef78084/lib/rdf/mixin/countable.rb', line 16

def empty?
  each {return false}
  true
end