Module: Brief::Document::Attachments
- Included in:
- Brief::Document
- Defined in:
- lib/brief/document/attachments.rb
Instance Method Summary collapse
- #attachment_paths ⇒ Object
- #attachments ⇒ Object
- #has_attachments? ⇒ Boolean
- #render_attachments ⇒ Object
Instance Method Details
#attachment_paths ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/brief/document/attachments.rb', line 12 def .reduce({}.to_mash) do |memo, name| if asset = briefcase.find_asset(name) memo[name] = asset.realpath.to_s memo end end end |
#attachments ⇒ Object
8 9 10 |
# File 'lib/brief/document/attachments.rb', line 8 def Array(data.) end |
#has_attachments? ⇒ Boolean
4 5 6 |
# File 'lib/brief/document/attachments.rb', line 4 def .length > 0 end |
#render_attachments ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/brief/document/attachments.rb', line 21 def .reduce({}.to_mash) do |memo, name| if asset = briefcase.find_asset(name) memo[name] = IO.read(asset) if asset.to_s.match(/\.svg/i) memo end end end |