class Mingle::Attachment

Attributes

filename[R]

Public Class Methods

api=(api) click to toggle source
# File lib/mingle/attachment.rb, line 12
def self.api=(api)
  @@api = api
end
find_all_by_card_number(number) click to toggle source
# File lib/mingle/attachment.rb, line 16
def self.find_all_by_card_number(number)
  [].tap do |attachments|
    xml = @@api.get_attachments_on(number)
    document = Nokogiri::XML.parse(xml)
    document.xpath('./attachments/attachment').each do |element|
      filename = element.xpath('./file_name').text
      attachments << Attachment.new(filename)
    end
  end
end
new(filename) click to toggle source
# File lib/mingle/attachment.rb, line 8
def initialize(filename)
  @filename = filename
end