Class: GoogleSimpleApi::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/google_simple_api/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Settings

Returns a new instance of Settings.



21
22
23
24
25
26
27
28
29
# File 'lib/google_simple_api/settings.rb', line 21

def initialize(options = {})
  @api = options[:api]
  @client_id = options[:client_id]
  @client_secret = options[:client_secret]
  @name = options[:name]
  @api_version = options[:api_version]
  @version = options[:version]
  @scope = [].push(options[:scope]).flatten
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def api
  @api
end

#api_clientObject

Returns the value of attribute api_client.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def api_client
  @api_client
end

#api_versionObject

Returns the value of attribute api_version.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def api_version
  @api_version
end

#client_idObject

Returns the value of attribute client_id.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def client_secret
  @client_secret
end

#discovered_apiObject

Returns the value of attribute discovered_api.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def discovered_api
  @discovered_api
end

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def scope
  @scope
end

#versionObject

Returns the value of attribute version.



18
19
20
# File 'lib/google_simple_api/settings.rb', line 18

def version
  @version
end

Instance Method Details

#load_apiObject



31
32
33
34
# File 'lib/google_simple_api/settings.rb', line 31

def load_api
  @api_client = load_api_client
  @discovered_api = discover_api if @api_client
end