Class: MongoParty

Inherits:
Object
  • Object
show all
Defined in:
lib/asterank-ruby/mongo_party.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMongoParty

Returns a new instance of MongoParty.



5
6
7
# File 'lib/asterank-ruby/mongo_party.rb', line 5

def initialize
  @results = nil
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



3
4
5
# File 'lib/asterank-ruby/mongo_party.rb', line 3

def results
  @results
end

Instance Method Details

#executeObject



13
14
15
16
17
18
# File 'lib/asterank-ruby/mongo_party.rb', line 13

def execute
  limit = options[:limit] || 10
  query = {query: selector.to_json, limit: limit}
  @results = self.class.get('', query: query)
  return @results
end