class Axiom::Adapter::Arango::Visitor::Header

Visitor for creating projected documents from axiom header

Public Instance Methods

document_attributes() click to toggle source

Return document attributes

@return [Enumerable<AQL::Node>]

@api private

# File lib/axiom/adapter/arango/visitor/header.rb, line 27
def document_attributes
  input.map do |attribute|
    document_attribute(attribute)
  end
end
root() click to toggle source

Return document node

@return [AQL::Node]

@api private

# File lib/axiom/adapter/arango/visitor/header.rb, line 16
def root
  Node::Literal::Composed::Document.new(document_attributes)
end

Private Instance Methods

document_attribute(attribute) click to toggle source

Return document attribute node

@return [Axiom::Attribute] attribute

@return [AQL::Node]

@api private

# File lib/axiom/adapter/arango/visitor/header.rb, line 44
def document_attribute(attribute)
  Node::Literal::Composed::Document::Attribute.new(
    Node::Literal::Primitive::String.new(attribute.name.to_s),
    visit(attribute, context)
  )
end