Class: Mapi::Msg::Attachment
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Attachment
#data, #filename, #inspect, #save, #to_mime, #to_tmail
Constructor Details
#initialize(obj, helper) ⇒ Attachment
Returns a new instance of Attachment.
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
|
# File 'lib/mapi/msg.rb', line 448
def initialize obj, helper
@obj = obj
@embedded_ole = nil
@embedded_msg = nil
super PropertySet.new(PropertyStore.load(@obj, helper))
Msg.warn_unknown @obj
@obj.children.each do |child|
if child.dir? and child.name =~ PropertyStore::SUBSTG_RX and
$1 == '3701' and $2.downcase == '000d'
@embedded_ole = child
class << @embedded_ole
def compobj
return nil unless compobj = self["\001CompObj"]
compobj.read[/^.{32}([^\x00]+)/m, 1]
end
def embedded_type
temp = compobj and return temp
if children.select { |child| child.name =~ /__(substg|properties|recip|attach|nameid)/ }.length > 2
return 'Microsoft Office Outlook Message'
end
nil
end
end
if @embedded_ole.embedded_type == 'Microsoft Office Outlook Message'
@embedded_msg = Msg.new @embedded_ole, helper
end
end
end
end
|
Instance Attribute Details
#obj ⇒ Ole::Storage::Dirent
439
440
441
|
# File 'lib/mapi/msg.rb', line 439
def obj
@obj
end
|
#properties ⇒ PropertySet
Also known as:
props
442
443
444
|
# File 'lib/mapi/msg.rb', line 442
def properties
@properties
end
|
Instance Method Details
#valid? ⇒ Boolean
484
485
486
487
488
|
# File 'lib/mapi/msg.rb', line 484
def valid?
not props.raw.keys.empty?
end
|