Class: PostProxy::PostSync

Inherits:
Model
  • Object
show all
Defined in:
lib/postproxy/types.rb

Overview

A record of one post pull for a profile — the sync fired when the profile connects, the recurring poll, or a backfill.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#to_h

Constructor Details

#initialize(**attrs) ⇒ PostSync

Returns a new instance of PostSync.



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/postproxy/types.rb', line 557

def initialize(**attrs)
  @started_at = nil
  @completed_at = nil
  @posts_seen = 0
  # Posts that were new and got created — lower than `posts_seen` whenever
  # the run re-read posts you already have.
  @posts_imported = 0
  @backfill_from = nil
  # Publish date of the oldest post the run reached.
  @oldest_posted_at = nil
  @error = nil
  super
  @started_at = parse_time(@started_at)
  @completed_at = parse_time(@completed_at)
  @backfill_from = parse_time(@backfill_from)
  @oldest_posted_at = parse_time(@oldest_posted_at)
  @created_at = parse_time(@created_at)
end

Instance Attribute Details

#backfill_fromObject

Returns the value of attribute backfill_from.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def backfill_from
  @backfill_from
end

#completed_atObject

Returns the value of attribute completed_at.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def completed_at
  @completed_at
end

#created_atObject

Returns the value of attribute created_at.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def created_at
  @created_at
end

#errorObject

Returns the value of attribute error.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def error
  @error
end

#idObject

Returns the value of attribute id.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def id
  @id
end

#kindObject

Returns the value of attribute kind.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def kind
  @kind
end

#oldest_posted_atObject

Returns the value of attribute oldest_posted_at.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def oldest_posted_at
  @oldest_posted_at
end

#posts_importedObject

Returns the value of attribute posts_imported.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def posts_imported
  @posts_imported
end

#posts_seenObject

Returns the value of attribute posts_seen.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def posts_seen
  @posts_seen
end

#profile_idObject

Returns the value of attribute profile_id.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def profile_id
  @profile_id
end

#started_atObject

Returns the value of attribute started_at.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def status
  @status
end

#triggerObject

Returns the value of attribute trigger.



553
554
555
# File 'lib/postproxy/types.rb', line 553

def trigger
  @trigger
end