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

Inherits:
Object
  • Object
show all
Defined in:
lib/kennel/syncer/types.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.



7
8
9
10
# File 'lib/kennel/syncer/types.rb', line 7

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

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



24
25
26
# File 'lib/kennel/syncer/types.rb', line 24

def klass
  @klass
end

#tracking_idObject (readonly)

Returns the value of attribute tracking_id.



24
25
26
# File 'lib/kennel/syncer/types.rb', line 24

def tracking_id
  @tracking_id
end

Instance Method Details

#api_resourceObject



12
13
14
# File 'lib/kennel/syncer/types.rb', line 12

def api_resource
  klass.api_resource
end

#change(id = nil) ⇒ Object



20
21
22
# File 'lib/kennel/syncer/types.rb', line 20

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

#url(id = nil) ⇒ Object



16
17
18
# File 'lib/kennel/syncer/types.rb', line 16

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