Class: ForestLiana::ResourcesGetter

Inherits:
Object
  • Object
show all
Defined in:
app/services/forest_liana/resources_getter.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource, params) ⇒ ResourcesGetter

Returns a new instance of ResourcesGetter.



3
4
5
6
# File 'app/services/forest_liana/resources_getter.rb', line 3

def initialize(resource, params)
  @resource = resource
  @params = params
end

Instance Method Details

#countObject



19
20
21
# File 'app/services/forest_liana/resources_getter.rb', line 19

def count
  @records.to_a.count
end

#performObject



8
9
10
11
12
13
# File 'app/services/forest_liana/resources_getter.rb', line 8

def perform
  @records = search_query
  @records = sort_query

  @records
end

#recordsObject



15
16
17
# File 'app/services/forest_liana/resources_getter.rb', line 15

def records
  @records.offset(offset).limit(limit).to_a
end