Class: TrackerApi::Endpoints::Attachments
- Defined in:
- lib/tracker_api/endpoints/attachments.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #create(comment, files) ⇒ Object
-
#initialize(client) ⇒ Attachments
constructor
A new instance of Attachments.
Constructor Details
#initialize(client) ⇒ Attachments
Returns a new instance of Attachments.
6 7 8 |
# File 'lib/tracker_api/endpoints/attachments.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/tracker_api/endpoints/attachments.rb', line 4 def client @client end |
Instance Method Details
#create(comment, files) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/tracker_api/endpoints/attachments.rb', line 11 def create(comment, files) return [] if files.to_a.empty? #Check files before upload to make it all or none. FileUtility.check_files_exist(files) = Endpoints::Attachment.new(client) files.map do | file | .create(comment, file) end end |