Class: OpenStax::Connect::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/openstax_connect.rb', line 59

def initialize      
  @openstax_application_id = 'SET ME!'
  @openstax_application_secret = 'SET ME!'
  @openstax_accounts_url = 'https://accounts.openstax.org/'
  @enable_stubbing = true
  @logout_via = :get
  @default_errors_partial = 'openstax/connect/shared/attention'
  @default_errors_html_id = 'openstax-connect-attention'
  @default_errors_added_trigger = 'openstax-connect-errors-added'
  @security_transgression_exception = OpenStax::Connect::SecurityTransgression
  @user_provider = OpenStax::Connect::UserProvider
  super
end

Instance Attribute Details

#default_errors_added_triggerObject

Returns the value of attribute default_errors_added_trigger.



47
48
49
# File 'lib/openstax_connect.rb', line 47

def default_errors_added_trigger
  @default_errors_added_trigger
end

#default_errors_html_idObject

Returns the value of attribute default_errors_html_id.



46
47
48
# File 'lib/openstax_connect.rb', line 46

def default_errors_html_id
  @default_errors_html_id
end

#default_errors_partialObject

Returns the value of attribute default_errors_partial.



45
46
47
# File 'lib/openstax_connect.rb', line 45

def default_errors_partial
  @default_errors_partial
end

#enable_stubbingObject

Returns the value of attribute enable_stubbing.



42
43
44
# File 'lib/openstax_connect.rb', line 42

def enable_stubbing
  @enable_stubbing
end

#logout_viaObject

Returns the value of attribute logout_via.



44
45
46
# File 'lib/openstax_connect.rb', line 44

def logout_via
  @logout_via
end

#openstax_accounts_urlObject

Returns the value of attribute openstax_accounts_url.



43
44
45
# File 'lib/openstax_connect.rb', line 43

def openstax_accounts_url
  @openstax_accounts_url
end

#openstax_application_idObject

Returns the value of attribute openstax_application_id.



40
41
42
# File 'lib/openstax_connect.rb', line 40

def openstax_application_id
  @openstax_application_id
end

#openstax_application_secretObject

Returns the value of attribute openstax_application_secret.



41
42
43
# File 'lib/openstax_connect.rb', line 41

def openstax_application_secret
  @openstax_application_secret
end

#security_transgression_exceptionObject

Returns the value of attribute security_transgression_exception.



48
49
50
# File 'lib/openstax_connect.rb', line 48

def security_transgression_exception
  @security_transgression_exception
end

#user_providerObject

See the “user_provider” discussion in the README



51
52
53
# File 'lib/openstax_connect.rb', line 51

def user_provider
  @user_provider
end

Instance Method Details

#enable_stubbing?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/openstax_connect.rb', line 73

def enable_stubbing?
  !Rails.env.production? && enable_stubbing
end