Skip to content

Conversation

@danny-beton-lrn
Copy link

Summary

Adds comprehensive Data API support to the Ruby SDK, following the pattern established in the Node.js SDK.

Changes

Core Implementation

  • New DataApi class (lib/learnosity/sdk/request/data_api.rb)
    • request() - Make single authenticated Data API requests
    • request_iter() - Iterate through paginated responses (returns Enumerator)
    • results_iter() - Iterate through individual results across pages (returns Enumerator)
    • Automatic routing metadata headers: X-Learnosity-Consumer, X-Learnosity-Action, X-Learnosity-SDK

Rails Quickstart Integration

  • Added Data API demo to quickstart application
    • Controller: app/controllers/data_api_controller.rb
    • View: app/views/data_api/index.html.erb
    • Route: /data_api/index
    • Demonstrates all three iteration methods with live API calls

Ruby 2.6 Compatibility Fixes

  • Commented out spring and spring-watcher-listen gems (require Ruby 2.7+)
  • Added require 'logger' to config/boot.rb for Rails 6.1 compatibility
  • Updated README to document Ruby 2.6+ support

Testing

  • Unit tests: spec/learnosity/sdk/request/data_api_spec.rb
  • Integration tests: spec/integration/data_api_spec.rb
  • Example usage: examples/simple/data_api_example.rb

Documentation

  • Updated REFERENCE.md with Data API usage examples
  • Updated README.md with Ruby version compatibility notes

Testing

All existing tests pass. New tests added for Data API functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants