Module: Itext::Attachments
- Included in:
- Itext
- Defined in:
- lib/itext/attachments.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #add_attachments(attachments) ⇒ Object (also: #add_attachment)
- #initialize(*args, &block) ⇒ Object
- #remove_attachments(attachments) ⇒ Object (also: #remove_attachment)
Class Method Details
.included(base) ⇒ Object
11 12 13 14 |
# File 'lib/itext/attachments.rb', line 11 def self.included(base) base.extend(ClassMethods) attr_reader :attachments end |
Instance Method Details
#add_attachments(attachments) ⇒ Object Also known as: add_attachment
16 17 18 19 20 21 22 23 |
# File 'lib/itext/attachments.rb', line 16 def () @attachments ||= [] = [] unless .is_a?(Array) .each do || @attachments << end @attachments end |
#initialize(*args, &block) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/itext/attachments.rb', line 4 def initialize(*args, &block) @hooks ||= [] @hooks.push ->{ } super rescue nil end |
#remove_attachments(attachments) ⇒ Object Also known as: remove_attachment
27 28 29 30 31 32 33 34 |
# File 'lib/itext/attachments.rb', line 27 def () @attachments ||= [] = [] unless .is_a?(Array) .each do || @attachments.delete() end @attachments end |