Sha256: 2581c4fffba23095e1e0dcfa2afd714edc35f85635b679c4d586ad606d9d243e

Contents?: true

Size: 1.31 KB

Versions: 12

Compression:

Stored size: 1.31 KB

Contents

module Pacer::Core::Graph

  # This module adds route methods to the basic graph classes returned from the
  # blueprints library.
  module GraphRoute
    # Returns a new route to all graph vertices. Standard filter options.
    def v(*filters, &block)
      filters = Pacer::Route.filters(filters)
      route = chain_route :element_type => :vertex,
        :pipe_class => Pacer::Pipes::VerticesPipe,
        :route_name => 'GraphV'
      Pacer::Route.property_filter(route, filters, block)
    end

    # Returns a new route to all graph edges. Standard filter options.
    def e(*filters, &block)
      filters = Pacer::Route.edge_filters(filters)
      route = chain_route :element_type => :edge,
        :pipe_class => Pacer::Pipes::EdgesPipe,
        :route_name => 'GraphE'
      Pacer::Route.property_filter(route, filters, block)
    end

    def filter(*args)
      raise 'Not implemented'
    end

    # Specialization of result simply returns self.
    def result
      self
    end

    # The graph itself is as root as you can get.
    def root?
      true
    end

    def graph
      # This must be defined here to overwrite the #graph method in Route.
      self
    end

    def ==(other)
      equal?(other)
    end

    # Don't try to inspect the graph data when inspecting.
    def hide_elements
      true
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pacer-1.3.5-java lib/pacer/core/graph/graph_route.rb
pacer-1.3.4-java lib/pacer/core/graph/graph_route.rb
pacer-1.3.3-java lib/pacer/core/graph/graph_route.rb
pacer-1.3.2-java lib/pacer/core/graph/graph_route.rb
pacer-1.3.1-java lib/pacer/core/graph/graph_route.rb
pacer-1.2.0-java lib/pacer/core/graph/graph_route.rb
pacer-1.1.1-java lib/pacer/core/graph/graph_route.rb
pacer-1.1.0-java lib/pacer/core/graph/graph_route.rb
pacer-1.0.3-java lib/pacer/core/graph/graph_route.rb
pacer-1.0.2-java lib/pacer/core/graph/graph_route.rb
pacer-1.0.1-java lib/pacer/core/graph/graph_route.rb
pacer-1.0.0-java lib/pacer/core/graph/graph_route.rb