Module: Xxx

Defined in:
lib/xxx.rb,
lib/xxx/youporn.rb,
lib/xxx/szukaj_cipki.rb

Defined Under Namespace

Classes: SzukajCipki, Youporn

Constant Summary collapse

CHANNEL_NAMES =
[:youporn, :szukajcipki]

Class Method Summary collapse

Class Method Details

.watch_porn(channel_name, command = "latest") ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/xxx.rb', line 12

def watch_porn(channel_name, command = "latest")
  channel_name ||= CHANNEL_NAMES.sort_by { rand }.first
  channel = open_channel(channel_name)

  if channel.respond_to?(command)
    uri = channel.send(command)
    Launchy.open(uri)
  else
    raise ArgumentError, "unknown command: #{command}"
  end
end