Class: Ruboty::Chinachu::Actions::Base

Inherits:
Actions::Base
  • Object
show all
Defined in:
lib/ruboty/chinachu/actions/base.rb

Direct Known Subclasses

Program, Recorded, Recording, Reserves, Schedule

Constant Summary collapse

PROGRAM_FORMAT =
ENV['CHINACHU_PROGRAM_FORMAT'] || '%title% #%episode%(%id%) %start% - %end%'

Instance Method Summary collapse

Instance Method Details

#chinachuObject



8
9
10
# File 'lib/ruboty/chinachu/actions/base.rb', line 8

def chinachu
  @chinachu ||= Goraku::Client.new(chinachu_options)
end

#chinachu_optionsObject



12
13
14
15
16
17
18
# File 'lib/ruboty/chinachu/actions/base.rb', line 12

def chinachu_options
  opts = {api_endpoint: ENV['CHINACHU_API_ENDPOINT'], raise_error: true}
  return opts unless ENV['CHINACHU_LOGIN'] || ENV['CHINACHU_PASSWORD']
  opts[:login]     = ENV['CHINACHU_LOGIN']
  opts[:password]  = ENV['CHINACHU_PASSWORD']
  opts
end