Class: Wework::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/wework/engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Engine

Returns a new instance of Engine.



6
7
8
9
10
11
# File 'lib/wework/engine.rb', line 6

def initialize(options={})
  @corp_id = options[:corp_id]
  @corp_secret = options[:corp_secret]
  @app_id = options[:app_id]
  @app_secret = options[:app_secret]
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



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

def app_id
  @app_id
end

#app_secretObject (readonly)

Returns the value of attribute app_secret.



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

def app_secret
  @app_secret
end

#corp_idObject (readonly)

Returns the value of attribute corp_id.



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

def corp_id
  @corp_id
end

#corp_secretObject (readonly)

Returns the value of attribute corp_secret.



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

def corp_secret
  @corp_secret
end

Instance Method Details

#agentObject



17
18
19
# File 'lib/wework/engine.rb', line 17

def agent
  @agent ||= Wework::Api::Agent.new(corp_id, app_id, app_secret) if agent?
end

#contactObject



13
14
15
# File 'lib/wework/engine.rb', line 13

def contact
  @contact ||= Wework::Api::Contact.new(corp_id, corp_secret) if contact?
end