lib/hari/node/queries.rb in hari-0.0.3 vs lib/hari/node/queries.rb in hari-0.0.4
- old
+ new
@@ -1,31 +1,33 @@
-require 'hari/node/queries/list'
-require 'hari/node/queries/set'
-require 'hari/node/queries/sorted_set'
-require 'hari/node/queries/relation'
-
module Hari
class Node < Entity
module Queries
+ autoload :Relation, 'hari/node/queries/relation'
+ autoload :Type, 'hari/node/queries/type'
delegate :in, :out, to: :relation_query
delegate :set, :set!, to: :set_query
delegate :sorted_set, :sorted_set!, to: :sorted_set_query
delegate :list, :list!, to: :list_query
+ delegate :string, :string!, to: :string_query
private
def set_query
- Queries::Set.new query_node
+ Keys::Set.new query_node
end
def sorted_set_query
- Queries::SortedSet.new query_node
+ Keys::SortedSet.new query_node
end
def list_query
- Queries::List.new query_node
+ Keys::List.new query_node
+ end
+
+ def string_query
+ Keys::String.new query_node
end
def relation_query
Queries::Relation::Start.new query_node
end