Module: StrawberryAPI::Client::Edits

Included in:
StrawberryAPI::Client
Defined in:
lib/strawberry_api/client/edits.rb

Instance Method Summary collapse

Instance Method Details

#edit(id:) ⇒ StrawberryAPI::Edit

Fetches an edit

Parameters:

  • id (Integer)

    Id of the edit to retrieve

Returns:



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_clearBoolean

Clears an edit

Returns:

  • (Boolean)

    Success



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

Returns:

  • (<type>)

    <description>



32
33
34
# File 'lib/strawberry_api/client/edits.rb', line 32

def edit_status
  get("/edit/status").parse['hash']
end

#editsArray<StrawberryAPI::Edit>

Fetches all edits

Returns:



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