class Baidupan::Config
Attributes
config[R]
Public Class Methods
file_path(*files)
click to toggle source
# File lib/baidupan/config.rb, line 22 def file_path(*files) base_file = File.join(self.base_url, 'file') files.each do |file| base_file = File.join(base_file, file.to_s) end base_file end
join_path(*files)
click to toggle source
# File lib/baidupan/config.rb, line 43 def join_path(*files) files.inject(self.app_root) do |rpath, lpath| File.join(rpath, lpath.to_s) end end
method_missing(method, *args)
click to toggle source
# File lib/baidupan/config.rb, line 18 def method_missing(method, *args) single_instance.config[method.to_sym] end
new()
click to toggle source
# File lib/baidupan/config.rb, line 52 def initialize @config = YAML.load_file(CONF_FILE) end
other_api_path(api)
click to toggle source
# File lib/baidupan/config.rb, line 35 def other_api_path(api) File.join(self.base_url, api.to_s) end
single_instance()
click to toggle source
# File lib/baidupan/config.rb, line 14 def single_instance @_instance ||= new end
thumbnail()
click to toggle source
# File lib/baidupan/config.rb, line 31 def thumbnail File.join(self.base_url, "thumbnail") end
time_format()
click to toggle source
# File lib/baidupan/config.rb, line 39 def time_format "%Y%m%d%H%M%S" end