Class: IMS::LTI::ToolBase

Inherits:
Object
  • Object
show all
Includes:
Extensions::Base, LaunchParams, RequestValidator
Defined in:
lib/ims/lti/tool_base.rb

Direct Known Subclasses

OutcomeRequest, ToolConsumer, ToolProvider

Constant Summary

Constants included from LaunchParams

LaunchParams::LAUNCH_DATA_PARAMETERS

Instance Attribute Summary collapse

Attributes included from RequestValidator

#oauth_signature_validator

Attributes included from LaunchParams

#custom_params, #ext_params, #non_spec_params

Instance Method Summary collapse

Methods included from RequestValidator

#request_oauth_nonce, #request_oauth_timestamp, #valid_request!, #valid_request?

Methods included from LaunchParams

#get_custom_param, #get_ext_param, #get_non_spec_param, #process_params, #roles=, #set_custom_param, #set_ext_param, #set_non_spec_param, #to_params

Methods included from Extensions::Base

#extend_outcome_request, #extend_outcome_response, #outcome_request_extensions, #outcome_response_extensions

Constructor Details

#initialize(consumer_key, consumer_secret, params = {}) ⇒ ToolBase

Returns a new instance of ToolBase.



10
11
12
13
14
15
16
17
# File 'lib/ims/lti/tool_base.rb', line 10

def initialize(consumer_key, consumer_secret, params={})
  @consumer_key = consumer_key
  @consumer_secret = consumer_secret
  @custom_params = {}
  @ext_params = {}
  @non_spec_params = {}
  process_params(params)
end

Instance Attribute Details

#consumer_keyObject

OAuth credentials



8
9
10
# File 'lib/ims/lti/tool_base.rb', line 8

def consumer_key
  @consumer_key
end

#consumer_secretObject

OAuth credentials



8
9
10
# File 'lib/ims/lti/tool_base.rb', line 8

def consumer_secret
  @consumer_secret
end

Instance Method Details

#post_service_request(url, content_type, body) ⇒ Object

Convenience method for doing oauth signed requests to services that aren’t supported by this library



21
22
23
24
25
26
27
# File 'lib/ims/lti/tool_base.rb', line 21

def post_service_request(url, content_type, body)
  IMS::LTI::post_service_request(@consumer_key,
                                 @consumer_secret,
                                 url,
                                 content_type,
                                 body)
end