Module: Zena::Remote::Interface::Read

Included in:
ClassMethods, ConnectionMethods, InstanceMethods
Defined in:
lib/zena/remote/interface.rb

Overview

Methods to retrieve remote nodes.

Defined Under Namespace

Modules: ClassMethods, ConnectionMethods, InstanceMethods

Instance Method Summary collapse

Instance Method Details

#all(query, options = {}) ⇒ Object



134
135
136
# File 'lib/zena/remote/interface.rb', line 134

def all(query, options = {})
  process_find(:all, query, options)
end

#count(query, options = {}) ⇒ Object



142
143
144
# File 'lib/zena/remote/interface.rb', line 142

def count(query, options = {})
  process_find(:count, query, options)
end

#find(count, query = nil, options = {}) ⇒ Object

Find remote nodes with query builder or indexed search



122
123
124
125
126
127
128
# File 'lib/zena/remote/interface.rb', line 122

def find(count, query = nil, options = {})
  if query.nil?
    query = count
    count = count.kind_of?(Fixnum) ? :first : :all
  end
  process_find(count, query, options)
end

#first(query, options = {}) ⇒ Object



138
139
140
# File 'lib/zena/remote/interface.rb', line 138

def first(query, options = {})
  process_find(:first, query, options)
end

#search(query, options = {}) ⇒ Object



130
131
132
# File 'lib/zena/remote/interface.rb', line 130

def search(query, options = {})
  process_find(:all, {:q => query}, options)
end