Class: BigMachines::Attachment
- Inherits:
-
Object
- Object
- BigMachines::Attachment
- Defined in:
- lib/big_machines/attachment.rb
Instance Attribute Summary collapse
-
#raw_attachment ⇒ Object
readonly
Returns the value of attribute raw_attachment.
Instance Method Summary collapse
-
#initialize(entry) ⇒ Attachment
constructor
A new instance of Attachment.
- #method_missing(method, *args) ⇒ Object
- #write(file_path) ⇒ Object
Constructor Details
#initialize(entry) ⇒ Attachment
5 6 7 |
# File 'lib/big_machines/attachment.rb', line 5 def initialize(entry) = entry end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
16 17 18 |
# File 'lib/big_machines/attachment.rb', line 16 def method_missing(method, *args) [method.to_s] end |
Instance Attribute Details
#raw_attachment ⇒ Object (readonly)
Returns the value of attribute raw_attachment.
3 4 5 |
# File 'lib/big_machines/attachment.rb', line 3 def end |
Instance Method Details
#write(file_path) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/big_machines/attachment.rb', line 9 def write(file_path) data = Base64.strict_decode64(["file_content"]) File.open(file_path, 'wb') do |f| f.write(data) end end |