Sha256: c961809e844f5b6628fbf79b98a8d075c0ce535469be134beba85442ea255ecc

Contents?: true

Size: 669 Bytes

Versions: 37

Compression:

Stored size: 669 Bytes

Contents

module MeducationSDK
  class GroupInvite < Resource
    self.path = "/group_invites"

    def group
      return nil unless group_id.to_i > 0
      @group ||= Group.find(group_id)
    end

    def invited_by
      return nil unless invited_by_id.to_i > 0
      @invited_by ||= User.find(invited_by_id)
    end

    def user
      return nil unless user_id.to_i > 0
      @user ||= User.find(user_id)
    end
  end

  class GroupInviteMock < GroupInvite
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      group_id: 8,
      user_id: 8,
      invited_by_id: 12,
      message: "",
      email: "",
      accept_code: "123asdqwe"
    }
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
meducation_sdk-1.6.10 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.6 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.5 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.4 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.3 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.2 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.1 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.6.0 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.7 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.6 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.5 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.4 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.3 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.2 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.1 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.5.0 lib/meducation_sdk/resources/group_invite.rb
meducation_sdk-1.4.4 lib/meducation_sdk/resources/group_invite.rb