Class: RongCloud::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rongcloud/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
14
15
16
17
# File 'lib/rongcloud/client.rb', line 9

def initialize(options)
  @app_key = options.fetch(:app_key)
  @app_secret = options.fetch(:app_secret)
  @http = Http.new(
    self,
    host: options.fetch(:host),
    options: options[:http] || {}
  )
end

Instance Attribute Details

#app_keyObject (readonly)

Returns the value of attribute app_key.



5
6
7
# File 'lib/rongcloud/client.rb', line 5

def app_key
  @app_key
end

#app_secretObject (readonly)

Returns the value of attribute app_secret.



5
6
7
# File 'lib/rongcloud/client.rb', line 5

def app_secret
  @app_secret
end

Instance Method Details

#apiObject



19
20
21
22
23
# File 'lib/rongcloud/client.rb', line 19

def api
  @api ||= Struct.new(:client) do
    include ::RongCloud::API
  end.new(self)
end