Module: Kuaipan::Config

Extended by:
Forwardable
Defined in:
lib/kuaipan/config.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/kuaipan/config.rb', line 7

def options
  @options
end

Class Method Details

.options_baseObject



27
28
29
30
31
32
33
34
# File 'lib/kuaipan/config.rb', line 27

def options_base
  {oauth_signature_method: Config.options[:oauth_signature_method],
   oauth_version: Config.options[:oauth_version],
   oauth_consumer_key: Config.options[:oauth_consumer_key],
   rtoken_path: Config.options[:rtoken_path],
   atoken_path: Config.options[:atoken_path],
   site: Config.options[:site]}
end

.opts(consumer_key, consumer_secret, p = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/kuaipan/config.rb', line 9

def opts(consumer_key, consumer_secret, p={})
  Config.options = {oauth_consumer_secret: consumer_secret,
                    oauth_consumer_key: consumer_key,
                    root: 'app_folder',
                    oauth_signature_method: 'HMAC-SHA1',
                    oauth_version: '1.0',
                    
                    site: 'openapi.kuaipan.cn',
                    thum_doc_site: 'conv.kuaipan.cn',
                    up_down_file_stie: 'api-content.dfs.kuaipan.cn',
                    rtoken_path: '/open/requestToken',
                    atoken_path: '/open/accessToken',
                    authorize_url: 'https://www.kuaipan.cn/api.php?ac=open&op=authorise',
                    types: %w(pdf doc wps csv prn xls et ppt dps txt rtf),
                    views: %w(normal android iPad iphone)
    }.merge(p)
end