Class: Storage::Algolia::Actions::Delete

Inherits:
Base show all
Defined in:
lib/storage/algolia/actions/delete.rb

Constant Summary collapse

MAX_RETRIES =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationService

process

Constructor Details

#initialize(model_name:, id:) ⇒ Delete

Returns a new instance of Delete.



13
14
15
16
17
# File 'lib/storage/algolia/actions/delete.rb', line 13

def initialize(model_name:, id:)
  @model_name = model_name
  @id = id
  @retries = 0
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/storage/algolia/actions/delete.rb', line 11

def id
  @id
end

#model_nameObject (readonly)

Returns the value of attribute model_name.



11
12
13
# File 'lib/storage/algolia/actions/delete.rb', line 11

def model_name
  @model_name
end

#retriesObject (readonly)

Returns the value of attribute retries.



11
12
13
# File 'lib/storage/algolia/actions/delete.rb', line 11

def retries
  @retries
end

Instance Method Details

#processObject



19
20
21
# File 'lib/storage/algolia/actions/delete.rb', line 19

def process
  index.delete_object(original_object.id)
end