Class: Kennel::Syncer::Types::PlannedChange

Inherits:
Object
  • Object
show all
Defined in:
lib/kennel/syncer.rb

Direct Known Subclasses

PlannedCreate, PlannedDelete, PlannedUpdate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, tracking_id) ⇒ PlannedChange

Returns a new instance of PlannedChange.



317
318
319
320
# File 'lib/kennel/syncer.rb', line 317

def initialize(klass, tracking_id)
  @klass = klass
  @tracking_id = tracking_id
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



334
335
336
# File 'lib/kennel/syncer.rb', line 334

def klass
  @klass
end

#tracking_idObject (readonly)

Returns the value of attribute tracking_id.



334
335
336
# File 'lib/kennel/syncer.rb', line 334

def tracking_id
  @tracking_id
end

Instance Method Details

#api_resourceObject



322
323
324
# File 'lib/kennel/syncer.rb', line 322

def api_resource
  klass.api_resource
end

#change(id = nil) ⇒ Object



330
331
332
# File 'lib/kennel/syncer.rb', line 330

def change(id = nil)
  Change.new(self.class::TYPE, api_resource, tracking_id, id)
end

#url(id = nil) ⇒ Object



326
327
328
# File 'lib/kennel/syncer.rb', line 326

def url(id = nil)
  klass.url(id || self.id)
end