Class: Ruboty::Chinachu::Actions::Base
- Inherits:
-
Actions::Base
- Object
- Actions::Base
- Ruboty::Chinachu::Actions::Base
show all
- Defined in:
- lib/ruboty/chinachu/actions/base.rb
Constant Summary
collapse
- PROGRAM_FORMAT =
ENV['CHINACHU_PROGRAM_FORMAT'] || '%title% #%episode%(%id%) %start% - %end%'
Instance Method Summary
collapse
Instance Method Details
#chinachu ⇒ Object
8
9
10
|
# File 'lib/ruboty/chinachu/actions/base.rb', line 8
def chinachu
@chinachu ||= Goraku::Client.new(chinachu_options)
end
|
#chinachu_options ⇒ Object
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
|