class Yarrow::Content::Graph
A directed graph of every element of content in the project.
Attributes
config[R]
graph[R]
Public Class Methods
from_source(config)
click to toggle source
Construct a graph collected from files and directories in the configured content directory.
@return [Yarrow::Content::Graph]
# File lib/yarrow/content/graph.rb, line 9 def self.from_source(config) new(Source.collect(config.source_dir), config) end
new(graph, config)
click to toggle source
# File lib/yarrow/content/graph.rb, line 15 def initialize(graph, config) @graph = graph @config = config end
Public Instance Methods
collections()
click to toggle source
List of mapped content object collections
# File lib/yarrow/content/graph.rb, line 31 def collections graph.nodes(:collection) end
directories()
click to toggle source
List of source directories.
# File lib/yarrow/content/graph.rb, line 26 def directories graph.nodes(:directory) end
files()
click to toggle source
List of source files.
# File lib/yarrow/content/graph.rb, line 21 def files graph.nodes(:file) end
items()
click to toggle source
List of mapped content object items
# File lib/yarrow/content/graph.rb, line 36 def items graph.nodes(:item) end