education/classroom

View on GitHub
lib/github_classroom/lti/models/membership_service/membership_subject.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

# rubocop:disable ClassAndModuleChildren
module GitHubClassroom::LTI::Models::MembershipService
  class MembershipSubject < IMS::LTI::Models::LTIModel
    add_attribute :membership, relation: "GitHubClassroom::LTI::Models::MembershipService::Membership"

    add_attribute :context, json_key: "contextId"
    add_attribute :id, json_key: "@id"
    add_attribute :type, json_key: "@type"

    def memberships
      [*@membership]
    end
  end
end
# rubocop:enable ClassAndModuleChildren