module StrawberryAPI::Client::Edits

Public Instance Methods

edit(id:) click to toggle source

Fetches an edit

@param [Integer] id Id of the edit to retrieve

@return [StrawberryAPI::Edit] The fetched edit

# 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() click to toggle source

Clears an edit

@return [Boolean] Success

# File lib/strawberry_api/client/edits.rb, line 41
def edit_clear
  put("/edit/clear").success?
end
edit_status() click to toggle source

Fetches an edit status

@return [<type>] <description>

# File lib/strawberry_api/client/edits.rb, line 32
def edit_status
  get("/edit/status").parse['hash']
end
edits() click to toggle source

Fetches all edits

@return [Array<StrawberryAPI::Edit>] A list of edits

# File lib/strawberry_api/client/edits.rb, line 10
def edits
  get("/edits").parse['edits']&.map do |edit|
    Edit.new(edit)
  end
end