Module: DK::TDrafts
- Included in:
- Client
- Defined in:
- lib/draftking/drafts.rb
Overview
Draft methods
Instance Method Summary collapse
-
#drafts_to_queue(options = {}) ⇒ int
Move Drafts to Queue.
-
#strip_old_comments(options = {}) ⇒ int
Remove comment tree.
Instance Method Details
#drafts_to_queue(options = {}) ⇒ int
Move Drafts to Queue
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/draftking/drafts.rb', line 25 def drafts_to_queue( = {}) [:message] = 'Moving Drafts -> Queue: ' [:shuffle] = true [:state] = DK::QUEUE post_operation() do |post, index| next false unless index_within_limit?(index, @q_size) next false unless post.passes_filter?(filter: @filter) changed = post.replace_comment(comment: @comment) changed = post.change_state(state: @state) || changed changed = post.(keep_tags: @keep_tags, add_tags: @tags, exclude: @comment, credit: @credit) || changed changed end end |
#strip_old_comments(options = {}) ⇒ int
Remove comment tree
9 10 11 12 13 14 |
# File 'lib/draftking/drafts.rb', line 9 def strip_old_comments( = {}) [:message] = 'Stripping previous comments: ' post_operation() do |_, _index| true end end |