Sha256: 7b62b9e6410d9f25a5a5955b979effbccb3e4000487784141de7147fcafe8e45

Contents?: true

Size: 445 Bytes

Versions: 28

Compression:

Stored size: 445 Bytes

Contents

module MeducationSDK
  class Notification < Resource
    self.path = "/notifications"

    def item
      @item ||= sdk_class_for(item_type).find(item_id)
    end

    def user
      @user ||= User.find(user_id)
    end
  end

  class NotificationMock < Notification
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      action: "comment_new",
      user_id: 5,
      item_id: 3,
      item_type: "Comment"
    }
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
meducation_sdk-1.6.10 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.6 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.5 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.4 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.3 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.2 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.1 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.6.0 lib/meducation_sdk/resources/notification.rb