Sha256: 17360071a482f1b765684eafed9ad883aea16f0e624ade4858e01648665466e8

Contents?: true

Size: 441 Bytes

Versions: 9

Compression:

Stored size: 441 Bytes

Contents

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

    def item
      @item ||= 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

9 entries across 9 versions & 1 rubygems

Version Path
meducation_sdk-1.5.7 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.6 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.5 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.4 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.3 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.2 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.1 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.5.0 lib/meducation_sdk/resources/notification.rb
meducation_sdk-1.4.4 lib/meducation_sdk/resources/notification.rb