Class: AQL::Node::Literal
- Defined in:
- lib/aql/node/literal.rb,
lib/aql/node/literal/composed.rb,
lib/aql/node/literal/primitive.rb,
lib/aql/node/literal/singleton.rb,
lib/aql/node/literal/composed/list.rb,
lib/aql/node/literal/primitive/number.rb,
lib/aql/node/literal/primitive/string.rb,
lib/aql/node/literal/composed/document.rb
Overview
Abstract base class for literal nodes
Direct Known Subclasses
Composed, Composed::Document::Attribute, Primitive, Singleton
Defined Under Namespace
Classes: Composed, Primitive, Singleton
Constant Summary collapse
- REGISTRY =
{}
Constants inherited from AQL::Node
Class Method Summary collapse
-
.build(object) ⇒ Node::Literal
private
Build literal handler.
-
.construct(*args) ⇒ Node::Literal
private
Construct object.
Methods inherited from AQL::Node
Class Method Details
.build(object) ⇒ Node::Literal
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build literal handler
28 29 30 31 32 33 34 |
# File 'lib/aql/node/literal.rb', line 28 def self.build(object) klass = object.class handler = REGISTRY.fetch(klass) do raise "No support for literal #{klass}" end handler.construct(object) end |
.construct(*args) ⇒ Node::Literal
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Construct object
42 43 44 |
# File 'lib/aql/node/literal.rb', line 42 def self.construct(*args) new(*args) end |