Class: DiscoApp::SynchroniseResourcesService

Inherits:
Object
  • Object
show all
Defined in:
app/services/disco_app/synchronise_resources_service.rb

Constant Summary collapse

PAGE_LIMIT =
250

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shop, class_name, params, since_id) ⇒ SynchroniseResourcesService

Returns a new instance of SynchroniseResourcesService.



12
13
14
15
16
17
# File 'app/services/disco_app/synchronise_resources_service.rb', line 12

def initialize(shop, class_name, params, since_id)
  @shop = shop
  @class_name = class_name
  @params = params
  @since_id = since_id
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



6
7
8
# File 'app/services/disco_app/synchronise_resources_service.rb', line 6

def class_name
  @class_name
end

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'app/services/disco_app/synchronise_resources_service.rb', line 6

def params
  @params
end

#shopObject (readonly)

Returns the value of attribute shop.



6
7
8
# File 'app/services/disco_app/synchronise_resources_service.rb', line 6

def shop
  @shop
end

#since_idObject (readonly)

Returns the value of attribute since_id.



6
7
8
# File 'app/services/disco_app/synchronise_resources_service.rb', line 6

def since_id
  @since_id
end

Class Method Details

.synchronise_all(shop, class_name, params, since_id = 0) ⇒ Object



8
9
10
# File 'app/services/disco_app/synchronise_resources_service.rb', line 8

def self.synchronise_all(shop, class_name, params, since_id = 0)
  new(shop, class_name, params, since_id).synchronise_all
end

Instance Method Details

#synchronise_allObject



19
20
21
22
# File 'app/services/disco_app/synchronise_resources_service.rb', line 19

def synchronise_all
  synchronise_page
  finish_or_loop
end