Class: PagesCore::AttachmentEmbedder
- Inherits:
-
Object
- Object
- PagesCore::AttachmentEmbedder
- Includes:
- ActionView::Helpers::AssetTagHelper
- Defined in:
- lib/pages_core/attachment_embedder.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
Instance Method Summary collapse
- #embed_attachment(attachment) ⇒ Object
- #embed_attachments(embedded_attachments) ⇒ Object
-
#initialize(attachments) ⇒ AttachmentEmbedder
constructor
A new instance of AttachmentEmbedder.
- #to_html ⇒ Object
Constructor Details
#initialize(attachments) ⇒ AttachmentEmbedder
Returns a new instance of AttachmentEmbedder.
7 8 9 |
# File 'lib/pages_core/attachment_embedder.rb', line 7 def initialize() @attachments = Array() end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
5 6 7 |
# File 'lib/pages_core/attachment_embedder.rb', line 5 def @attachments end |
Instance Method Details
#embed_attachment(attachment) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/pages_core/attachment_embedder.rb', line 19 def () content_tag( :a, .name, class: "file", href: () ) end |
#embed_attachments(embedded_attachments) ⇒ Object
15 16 17 |
# File 'lib/pages_core/attachment_embedder.rb', line 15 def () .join(", ") end |
#to_html ⇒ Object
11 12 13 |
# File 'lib/pages_core/attachment_embedder.rb', line 11 def to_html (.map { |f| (f) }) end |