Module: NetFlix

Defined in:
lib/net_flix.rb,
lib/net_flix/title.rb,
lib/net_flix/request.rb,
lib/net_flix/credentials.rb,
lib/net_flix/authenticator.rb,
lib/net_flix/api/catalog/titles.rb

Defined Under Namespace

Modules: API Classes: Authenticator, Credentials, Request, Title

Class Method Summary collapse

Class Method Details

.create_loggerObject



12
13
14
15
16
17
# File 'lib/net_flix.rb', line 12

def create_logger
  logdir = File.join( File.expand_path('log') )
  Dir.mkdir(logdir) unless File.exists? logdir

  Logger.new( logfile ) 
end

.credentialsObject



4
5
6
# File 'lib/net_flix.rb', line 4

def credentials
  @credentials ||= NetFlix::Credentials.from_file 
end

.log(message) ⇒ Object



23
24
25
# File 'lib/net_flix.rb', line 23

def log(message)
  NetFlix.logger.info("[#{Time.now.to_i}] #{message}")
end

.logfileObject



8
9
10
# File 'lib/net_flix.rb', line 8

def logfile
  File.join( File.expand_path('log'), 'netflix.log' )
end

.loggerObject



19
20
21
# File 'lib/net_flix.rb', line 19

def logger
  @logger ||= create_logger 
end