class Mingle::AttachmentLinkFinder
Attributes
attachment_links[R]
card_description_document[R]
Public Class Methods
new(description)
click to toggle source
# File lib/mingle/attachment_link_finder.rb, line 9 def initialize(description) @attachment_links = find_links(description) end
Private Instance Methods
find_links(html)
click to toggle source
# File lib/mingle/attachment_link_finder.rb, line 15 def find_links(html) @card_description_document = Nokogiri::HTML.parse(html) @card_description_document.search('a').inject([]) do |memo, anchor| href = anchor['href'] if href =~ /attachments/ memo << AttachmentLink.new(anchor) end memo end end