Class: SendWithUs::File
- Inherits:
-
Object
- Object
- SendWithUs::File
- Defined in:
- lib/send_with_us/file.rb
Instance Attribute Summary collapse
-
#attachment ⇒ Object
Returns the value of attribute attachment.
Instance Method Summary collapse
-
#initialize(file_data, opts = {}) ⇒ File
constructor
A new instance of File.
- #to_h ⇒ Object
Constructor Details
#initialize(file_data, opts = {}) ⇒ File
Returns a new instance of File.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/send_with_us/file.rb', line 5 def initialize(file_data, opts = {}) @attachment = if file_data.is_a?(String) SendWithUs::Attachment.new(file_data) else if file_data[:data] and file_data[:id] file_data else SendWithUs::Attachment.new(file_data[:attachment], file_data[:filename]) end end end |
Instance Attribute Details
#attachment ⇒ Object
Returns the value of attribute attachment.
3 4 5 |
# File 'lib/send_with_us/file.rb', line 3 def @attachment end |
Instance Method Details
#to_h ⇒ Object
17 18 19 |
# File 'lib/send_with_us/file.rb', line 17 def to_h .to_h end |