class RoadForest::PathMatcher::Match

Public Class Methods

new(matcher) click to toggle source
# File lib/roadforest/path-matcher.rb, line 10
def initialize(matcher)
  @success = matcher.completed_child.accepting?
  @graph = if @success
      statements = matcher.completed_child.matched_statements.keys
      ::RDF::Graph.new.tap do |graph|
        statements.each do |stmt|
          graph << stmt
        end
      end
    end
end

Public Instance Methods

graph() click to toggle source
# File lib/roadforest/path-matcher.rb, line 28
def graph
  if success?
    @graph
  else
    raise NoMatch, "Pattern doesn't match graph"
  end
end
succeed?()
Alias for: success?
success?() click to toggle source
# File lib/roadforest/path-matcher.rb, line 22
def success?
  @success
end
Also aliased as: successful?, succeed?
successful?()
Alias for: success?