class BigMachines::Attachment

Attributes

raw_attachment[R]

Public Class Methods

new(entry) click to toggle source
# File lib/big_machines/attachment.rb, line 5
def initialize(entry)
  @raw_attachment = entry
end

Public Instance Methods

method_missing(method, *args) click to toggle source
# File lib/big_machines/attachment.rb, line 16
def method_missing(method, *args)
  @raw_attachment[method.to_s]
end
write(file_path) click to toggle source
# File lib/big_machines/attachment.rb, line 9
def write(file_path)
  data = Base64.strict_decode64(@raw_attachment["file_content"])
  File.open(file_path, 'wb') do |f|
    f.write(data)
  end
end