Class: Mingle::HistoricalAttachments
- Inherits:
-
Object
- Object
- Mingle::HistoricalAttachments
- Defined in:
- lib/mingle/historical_attachments.rb
Instance Method Summary collapse
- #find_by_id(id) ⇒ Object
-
#initialize(path) ⇒ HistoricalAttachments
constructor
A new instance of HistoricalAttachments.
- #size ⇒ Object
Constructor Details
#initialize(path) ⇒ HistoricalAttachments
Returns a new instance of HistoricalAttachments.
7 8 9 10 11 12 13 |
# File 'lib/mingle/historical_attachments.rb', line 7 def initialize(path) @path = path = [] Dir[File.join(@path, 'attachments_*.yml')].each do |file| += YAML.load_file(file) end end |
Instance Method Details
#find_by_id(id) ⇒ Object
19 20 21 22 |
# File 'lib/mingle/historical_attachments.rb', line 19 def find_by_id(id) = .find { || ['id'].to_s == id.to_s } Attachment.new(['file']) if end |
#size ⇒ Object
15 16 17 |
# File 'lib/mingle/historical_attachments.rb', line 15 def size .size end |