Class: Porni::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/porni/client.rb

Direct Known Subclasses

Hubs::Porn

Constant Summary collapse

ALLOWED_PAGES =
['porn.com', 'redtube.com', 'pornhub.com']

Class Method Summary collapse

Class Method Details

.get_agent(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/porni/client.rb', line 7

def self.get_agent(options = {})
  page = options[:page]
  case page
  when 'porn'
    Porni::Hubs::Porn.new(options)
  when 'redtube'
    Porni::Hubs::Redtube.new(options)
  when 'xvideos'
    Porni::Hubs::Xvideos.new(options)
  when 'spankbang'
    Porni::Hubs::Spankbang.new(options)
  when 'pornhub'
    Porni::Hubs::Pornhub.new(options)
  else
    raise Porni::MissingApiError
  end
end