Module: Nearmiss::Client::Attachments
- Defined in:
- lib/toolhound-ruby/client/attachments.rb
Overview
Methods for the Attachments API
Instance Method Summary collapse
-
#attachment(attachment, options = {}) ⇒ Sawyer::Resource
Get a single attachment.
-
#attachments(options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_attachments)
List nearmiss attachments.
-
#create_attachment(options = {}) ⇒ Sawyer::Resource
Newly created attachment info.
-
#incident_attachments(incident, options = {}) ⇒ Sawyer::Resource
(also: #nearmiss_attachments)
Project attachments.
- #update_attachment(attachment, options = {}) ⇒ Object (also: #edit_attachment)
Instance Method Details
#attachment(attachment, options = {}) ⇒ Sawyer::Resource
Get a single attachment
26 27 28 |
# File 'lib/toolhound-ruby/client/attachments.rb', line 26 def (, = {}) get "attachments/#{}", end |
#attachments(options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_attachments
List nearmiss attachments
12 13 14 15 16 17 18 |
# File 'lib/toolhound-ruby/client/attachments.rb', line 12 def ( = {}) since = [:since] || ["since"] .merge!(since: iso8601(parse_date(since))) if since paginate "attachments", end |
#create_attachment(options = {}) ⇒ Sawyer::Resource
Returns Newly created attachment info.
54 55 56 |
# File 'lib/toolhound-ruby/client/attachments.rb', line 54 def ( = {}) post 'attachments', end |
#incident_attachments(incident, options = {}) ⇒ Sawyer::Resource Also known as: nearmiss_attachments
Project attachments
35 36 37 38 39 |
# File 'lib/toolhound-ruby/client/attachments.rb', line 35 def (incident, = {}) paginate "#{Incident.new(incident).path}/attachments", end |
#update_attachment(attachment, options = {}) ⇒ Object Also known as: edit_attachment
59 60 61 |
# File 'lib/toolhound-ruby/client/attachments.rb', line 59 def (, = {}) patch "attachments/#{}", end |