module TrelloCardRefinements

NOTE(chaserx): could put this module in trellist/ext and require relative

Public Instance Methods

as_deckset_markdown() click to toggle source
# File lib/trellist/client.rb, line 24
def as_deckset_markdown
  # NOTE(chaserx): I don't like this although functional. Maybe use erb?
  "\n# #{name}\n" + # slide title; required to start slide
  "\n#{desc}\n" + # slide body
  "\n[#{short_url}](#{short_url})\n" + # link back to card
  "\n#{formatted_attachments.join("\n")}\n" + # list of card attachements
  "\n---\n" # required to end slide
end
as_html(prefix: '', suffix: '') click to toggle source
# File lib/trellist/client.rb, line 16
def as_html(prefix: '', suffix: '')
  "#{prefix}<a href=\"#{short_url}\">#{name}</a>#{suffix}"
end
as_markdown(prefix: '', suffix: '') click to toggle source
# File lib/trellist/client.rb, line 12
def as_markdown(prefix: '', suffix: '')
  "#{prefix}[#{name}](#{short_url})#{suffix}"
end
as_plain_title(prefix: '', suffix: '') click to toggle source
# File lib/trellist/client.rb, line 20
def as_plain_title(prefix: '', suffix: '')
  "#{prefix}#{name}#{suffix}"
end
formatted_attachments() click to toggle source
# File lib/trellist/client.rb, line 33
def formatted_attachments
  attachments.map { |attachment| "\n[#{attachment.name}](#{attachment.url})\n" }
end