Class: DK::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/autofixer/patches/DK_Post.rb

Instance Method Summary collapse

Instance Method Details

#has_info?Boolean

Post has a summary or tags?

Returns:

  • (Boolean)


4
5
6
# File 'lib/autofixer/patches/DK_Post.rb', line 4

def has_info?
  has_summary? || !tags.empty?
end

#has_summary?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/autofixer/patches/DK_Post.rb', line 21

def has_summary?
  summary.strip.empty?
end

#has_trail?Boolean

Do we know where it was reblogged from?

Returns:

  • (Boolean)


9
10
11
# File 'lib/autofixer/patches/DK_Post.rb', line 9

def has_trail?
  !trail.empty?
end

#processed?(skip: false, prefix: '') ⇒ Boolean

Post already has prefix?

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/autofixer/patches/DK_Post.rb', line 14

def processed?(skip: false, prefix: '')
  return false if skip
  return false if prefix.empty?
  l_comment = Sanitize.fragment(comment).strip
  l_comment.start_with?(prefix) || summary.strip.start_with?(prefix)
end