Class: NoSE::Serialize::GraphRepresenter
- Inherits:
-
Representable::Decorator
- Object
- Representable::Decorator
- NoSE::Serialize::GraphRepresenter
- 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
Instance Method Details
#edges ⇒ Object
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 |
#nodes ⇒ Object
82 83 84 |
# File 'lib/nose/serialize.rb', line 82 def nodes represented.nodes.map { |n| n.entity.name } end |