Class: SeekParty::SeekPartyEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/seek_party/seek_party_engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inspected_class, params: {}, white_list: nil, black_list: nil, scopes: {}) ⇒ SeekPartyEngine

Returns a new instance of SeekPartyEngine.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/seek_party/seek_party_engine.rb', line 7

def initialize(inspected_class,
               params: {},
               white_list: nil,
               black_list: nil,
               scopes: {})
  @seek_party_attribute = SeekPartyAttribute.new(inspected_class,
                                                 white_list,
                                                 black_list)
  @seek_party_query = SeekPartyQueryBuilder.new(params)
  @inspected_class = inspected_class
  @scopes = scopes
end

Instance Attribute Details

#inspected_classObject

Returns the value of attribute inspected_class.



3
4
5
# File 'lib/seek_party/seek_party_engine.rb', line 3

def inspected_class
  @inspected_class
end

#seek_party_attributeObject

Returns the value of attribute seek_party_attribute.



3
4
5
# File 'lib/seek_party/seek_party_engine.rb', line 3

def seek_party_attribute
  @seek_party_attribute
end

#seek_party_queryObject

Returns the value of attribute seek_party_query.



3
4
5
# File 'lib/seek_party/seek_party_engine.rb', line 3

def seek_party_query
  @seek_party_query
end

Instance Method Details

#searchObject



20
21
22
23
24
# File 'lib/seek_party/seek_party_engine.rb', line 20

def search
  spa_attribute = seek_party_attribute.discover_attributes
  final_query = seek_party_query.build_query(spa_attribute)
  run_search(final_query)
end