Class: OpenStax::Api::Configuration

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

Overview

Configuration machinery.

To configure OpenStax Api, put the following code in your applications initialization logic (eg. in the config/initializers in a Rails app)

OpenStax::Api.configure do |config|
  config.<parameter name> = <parameter value>
  ...
end

user_class_name is a String containing the name of your User model class.

current_user_method is a String containing the name of your controller method that returns the current user.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



37
38
39
40
# File 'lib/openstax_api.rb', line 37

def initialize      
  @user_class_name = 'User'
  @current_user_method = 'current_user'
end

Instance Attribute Details

#current_user_methodObject

Returns the value of attribute current_user_method.



35
36
37
# File 'lib/openstax_api.rb', line 35

def current_user_method
  @current_user_method
end

#user_class_nameObject

Returns the value of attribute user_class_name.



34
35
36
# File 'lib/openstax_api.rb', line 34

def user_class_name
  @user_class_name
end