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.
9 10 11 |
# File 'lib/pages_core/attachment_embedder.rb', line 9 def initialize() @attachments = Array() end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
7 8 9 |
# File 'lib/pages_core/attachment_embedder.rb', line 7 def @attachments end |
Instance Method Details
#embed_attachment(attachment) ⇒ Object
21 22 23 24 |
# File 'lib/pages_core/attachment_embedder.rb', line 21 def () tag.a(.name, class: "file", href: ()) end |
#embed_attachments(embedded_attachments) ⇒ Object
17 18 19 |
# File 'lib/pages_core/attachment_embedder.rb', line 17 def () .join(", ") end |
#to_html ⇒ Object
13 14 15 |
# File 'lib/pages_core/attachment_embedder.rb', line 13 def to_html (.map { |f| (f) }) end |