Class: Mingle::Attachment
- Inherits:
-
Object
- Object
- Mingle::Attachment
- Defined in:
- lib/mingle/attachment.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(filename) ⇒ Attachment
Returns a new instance of Attachment.
8 9 10 |
# File 'lib/mingle/attachment.rb', line 8 def initialize(filename) @filename = filename end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
6 7 8 |
# File 'lib/mingle/attachment.rb', line 6 def filename @filename end |
Class Method Details
.api=(api) ⇒ Object
12 13 14 |
# File 'lib/mingle/attachment.rb', line 12 def self.api=(api) @@api = api end |
.find_all_by_card_number(number) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mingle/attachment.rb', line 16 def self.find_all_by_card_number(number) [].tap do || xml = @@api.(number) document = Nokogiri::XML.parse(xml) document.xpath('./attachments/attachment').each do |element| filename = element.xpath('./file_name').text << Attachment.new(filename) end end end |