Module: GoogleTts

Included in:
Client
Defined in:
lib/google_tts.rb,
lib/google_tts/parser.rb,
lib/google_tts/connector.rb,
lib/google_tts/mp3writer.rb,
lib/google_tts/proxy_fetcher.rb,
lib/google_tts/query_builder.rb

Defined Under Namespace

Classes: Client, Connector, Mp3Writer, Parser, ProxyFetcher, QueryBuilder

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.instantiate(params = {}) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/google_tts.rb', line 32

def self.instantiate(params = {})
  proxy = params[:proxy] || @proxy
  connection = proxy ? Net::HTTP::Proxy(proxy[:host], proxy[:port]) : Net::HTTP
  lang = params[:lang] || :en
  output = params[:output] || "out"
  Client.new(Connector.new(connection), QueryBuilder.new(lang), Mp3Writer.new(output))
end

.with_random_proxy(params = {}) ⇒ Object



40
41
42
43
# File 'lib/google_tts.rb', line 40

def self.with_random_proxy(params = {})
  @proxy = ProxyFetcher.random_proxy
  self
end