Sha256: 0a032d98dd79fc6c4751b533923c61eda4833ca978253b5a690e77c0d02efc31
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 KB
Contents
module AQL class Node class Literal class Composed # Literal document class Document < self handle(Hash) # Construct node from primitive # # @param [Hash] hash # # @return [Node::Literal::Document] # # @api private # def self.construct(hash) attributes = hash.map do |key, value| Attribute.new(Literal.build(key), Literal.build(value)) end new(attributes) end # Literal document attribute class Attribute < Literal include Concord.new(:key, :value) private # Emit node # # @return [self] # # @api private # def emit(buffer) key.visit(buffer) buffer.append(': ') value.visit(buffer) end end private # Emit node # # @return [undefined] # # @api private # def emit(buffer) buffer.wrap_delimited('{', body, '}') end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
aql-0.0.3 | lib/aql/node/literal/composed/document.rb |
aql-0.0.2 | lib/aql/node/literal/composed/document.rb |
aql-0.0.1 | lib/aql/node/literal/composed/document.rb |