Class: Swiftner::API::Transcription

Inherits:
Service
  • Object
show all
Defined in:
lib/swiftner/API/transcription.rb

Overview

Represents a Transcription service responsible for finding, creating, and deleting transcriptions. Inherits from the Service class. Provides methods for interacting with transcriptions.

Instance Attribute Summary

Attributes inherited from Service

#client, #details, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Service

build, client, #initialize, map_collection, validate_required

Constructor Details

This class inherits a constructor from Swiftner::API::Service

Class Method Details

.create(attributes) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/swiftner/API/transcription.rb', line 14

def self.create(attributes)
  response = client.post(
    "/transcription/create",
    body: attributes.to_json,
    headers: { "Content-Type" => "application/json" }
  )

  build(response.parsed_response)
end

.find(transcription_id) ⇒ Object



9
10
11
12
# File 'lib/swiftner/API/transcription.rb', line 9

def self.find(transcription_id)
  response = client.get("/transcription/get/#{transcription_id}")
  build(response.parsed_response)
end

Instance Method Details

#deleteObject



24
25
26
# File 'lib/swiftner/API/transcription.rb', line 24

def delete
  client.delete("/transcription/delete/#{id}")
end