Class: RoadForest::RDF::NullFocus

Inherits:
BasicObject
Defined in:
lib/roadforest/rdf/graph-focus.rb

Instance Method Summary collapse

Constructor Details

#initialize(focus, pattern, callsite) ⇒ NullFocus

Returns a new instance of NullFocus.



12
13
14
# File 'lib/roadforest/rdf/graph-focus.rb', line 12

def initialize(focus, pattern, callsite)
  @focus, @pattern, @callsite = focus, pattern, callsite
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



42
43
44
45
46
# File 'lib/roadforest/rdf/graph-focus.rb', line 42

def method_missing(method, *args, &block)
  ::Kernel.raise ::NoMethodError, "No method '#{method}' on NullFocus. " +
    "NullFocus returned because there were no results at \n#{@focus.subject}\n  for \n#{@pattern.inspect}\n" +
    "Search was attempted at #{@callsite[0]}"
end

Instance Method Details

#__callsite__Object



16
17
18
# File 'lib/roadforest/rdf/graph-focus.rb', line 16

def __callsite__
  @callsite
end

#blank?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/roadforest/rdf/graph-focus.rb', line 28

def blank?
  true
end

#empty?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/roadforest/rdf/graph-focus.rb', line 32

def empty?
  true
end

#lengthObject Also known as: count, size



36
37
38
# File 'lib/roadforest/rdf/graph-focus.rb', line 36

def length
  0
end

#nil?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/roadforest/rdf/graph-focus.rb', line 24

def nil?
  true
end

#subjectObject



20
21
22
# File 'lib/roadforest/rdf/graph-focus.rb', line 20

def subject
  @focus.subject
end