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.
- #strip_tags(options = {}) ⇒ Object
Instance Method Details
#drafts_to_queue(options = {}) ⇒ int
Move Drafts to Queue
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/draftking/drafts.rb', line 33 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_space) next false unless post.has_key_text?(@key_text) post.replace_comment_with(@comment) post.change_state(@state) post.(keep_tags: @keep_tags, add_tags: @tags, exclude: @comment, credit: @credit) if @auto_tag 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 |post, _| post.changed = true end end |
#strip_tags(options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/draftking/drafts.rb', line 16 def ( = {}) [:message] = 'Stripping previous comments: ' post_operation() do |post, _| post. end end |