Class: Force::Attachment

Inherits:
SObject show all
Defined in:
lib/force/attachment.rb

Instance Method Summary collapse

Methods inherited from SObject

#attrs, #describe, #describe_layouts, #destroy, #destroy!, #save, #save!, #sobject_type, #to_sparam

Methods inherited from Mash

build, #convert_value, #dup, #initialize, klass

Constructor Details

This class inherits a constructor from Force::Mash

Instance Method Details

#BodyObject

Public: Returns the body of the attachment.

Examples

attachment = client.query('select Id, Name, Body from Attachment').first
File.open(attachment.Name, 'wb') { |f| f.write(attachment.Body) }


9
10
11
12
# File 'lib/force/attachment.rb', line 9

def Body
  ensure_id && ensure_body
  @client.get(super).body
end