Module: StrawberryAPI::Client::Edits
- Included in:
- StrawberryAPI::Client
- Defined in:
- lib/strawberry_api/client/edits.rb
Instance Method Summary collapse
-
#edit(id:) ⇒ StrawberryAPI::Edit
Fetches an edit.
-
#edit_clear ⇒ Boolean
Clears an edit.
-
#edit_status ⇒ <type>
Fetches an edit status.
-
#edits ⇒ Array<StrawberryAPI::Edit>
Fetches all edits.
Instance Method Details
#edit(id:) ⇒ StrawberryAPI::Edit
Fetches an edit
22 23 24 25 |
# File 'lib/strawberry_api/client/edits.rb', line 22 def edit(id:) data = get("/edits/#{id}").parse['edit'] data.nil? ? nil : Edit.new(data) end |
#edit_clear ⇒ Boolean
Clears an edit
41 42 43 |
# File 'lib/strawberry_api/client/edits.rb', line 41 def edit_clear put("/edit/clear").success? end |
#edit_status ⇒ <type>
Fetches an edit status
32 33 34 |
# File 'lib/strawberry_api/client/edits.rb', line 32 def edit_status get("/edit/status").parse['hash'] end |
#edits ⇒ Array<StrawberryAPI::Edit>
Fetches all edits
10 11 12 13 14 |
# File 'lib/strawberry_api/client/edits.rb', line 10 def edits get("/edits").parse['edits']&.map do |edit| Edit.new(edit) end end |