Class: Cp8Cli::Trello::Card
- Includes:
- Storyable
- Defined in:
- lib/cp8_cli/trello/card.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#attach(url:) ⇒ Object
Used by CP-8 bot.
- #pr_title ⇒ Object
- #short_link ⇒ Object
- #start ⇒ Object
- #summary ⇒ Object
- #title ⇒ Object
Methods included from Storyable
Methods inherited from Base
Class Method Details
.fields ⇒ Object
10 11 12 |
# File 'lib/cp8_cli/trello/card.rb', line 10 def self.fields [:title] end |
.find_by_url(url) ⇒ Object
14 15 16 17 |
# File 'lib/cp8_cli/trello/card.rb', line 14 def self.find_by_url(url) card = Card.new(url: url) find(card.short_link) end |
Instance Method Details
#attach(url:) ⇒ Object
Used by CP-8 bot
41 42 43 |
# File 'lib/cp8_cli/trello/card.rb', line 41 def attach(url:) self.class.request(:post, "cards/#{id}/attachments", url: url) end |
#pr_title ⇒ Object
23 24 25 |
# File 'lib/cp8_cli/trello/card.rb', line 23 def pr_title "#{title} [Delivers ##{short_link}]" end |
#short_link ⇒ Object
36 37 38 |
# File 'lib/cp8_cli/trello/card.rb', line 36 def short_link url.scan(/\/c\/(.+)\//).flatten.first end |
#start ⇒ Object
31 32 33 34 |
# File 'lib/cp8_cli/trello/card.rb', line 31 def start move_to board.lists.started assign CurrentUser.new end |
#summary ⇒ Object
27 28 29 |
# File 'lib/cp8_cli/trello/card.rb', line 27 def summary "Trello: #{short_url}" end |
#title ⇒ Object
19 20 21 |
# File 'lib/cp8_cli/trello/card.rb', line 19 def title name end |