Class: Denglu::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/denglu/base.rb

Direct Known Subclasses

Comment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_id = nil, app_key = nil) ⇒ Base

Initialization

Example:

>> denglu = Denglu::Base.new
=> #<#Denglu::Base...>

Arguments:

app_id: (String)
app_key: (String)


18
19
20
21
22
23
24
25
# File 'lib/denglu/base.rb', line 18

def initialize(app_id=nil, app_key=nil)
  @app_id = app_id || Config.app_id
  @app_key = app_key || Config.app_key

  unless @app_id || @app_key
    raise 'Uninitialized app_id or app_key!'
  end
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



6
7
8
# File 'lib/denglu/base.rb', line 6

def app_id
  @app_id
end

#app_keyObject (readonly)

Returns the value of attribute app_key.



6
7
8
# File 'lib/denglu/base.rb', line 6

def app_key
  @app_key
end