Module: FreezeTag::InstanceMethods

Defined in:
lib/freezetag.rb

Instance Method Summary collapse

Instance Method Details

#freezetag_deindex_recordObject

[View source]

34
35
36
37
# File 'lib/freezetag.rb', line 34

def freezetag_deindex_record
  body = { type: self.class.name, id: self.id }
  HTTParty.delete(API_ENDPOINT, headers: { 'X-API-Key' => self.freezetag_api_key }, body: body)
end

#freezetag_index_recordObject

[View source]

29
30
31
32
# File 'lib/freezetag.rb', line 29

def freezetag_index_record
  body = { name: self.send(self.freezetag_attribute), type: self.class.name, id: self.id }
  HTTParty.post(API_ENDPOINT, headers: { 'X-API-Key' => self.freezetag_api_key }, body: body)
end