Class: NoSE::Serialize::GraphRepresenter

Inherits:
Representable::Decorator
  • Object
show all
Includes:
Representable::Hash, Representable::JSON, Representable::Uncached, Representable::YAML
Defined in:
lib/nose/serialize.rb

Overview

Represents a graph by its nodes and edges

Instance Method Summary collapse

Methods included from Representable::Uncached

#representable_map

Instance Method Details

#edgesObject



88
89
90
91
92
# File 'lib/nose/serialize.rb', line 88

def edges
  represented.unique_edges.map do |edge|
    FieldRepresenter.represent(edge.key).to_hash
  end
end

#nodesObject



82
83
84
# File 'lib/nose/serialize.rb', line 82

def nodes
  represented.nodes.map { |n| n.entity.name }
end