Sha256: 06c4861a60b725f10e66529b3bd3b8ed9a405864fcd8d2046f3b0fa14f3c479a

Contents?: true

Size: 470 Bytes

Versions: 10

Compression:

Stored size: 470 Bytes

Contents

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

    def item
      @item ||= "MeducationSDK::#{item_type}".constantize.find(item_id)
    end

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

  class NotificationMock < ItemComment
    extend Loquor::ResourceMock

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
meducation_sdk-0.5.0 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.4.1 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.4.0 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.3.4 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.3.3 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.3.2 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.3.1 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.3.0 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.2.0 lib/meducation_sdk/resources/notification.rb
meducation_sdk-0.1.0 lib/meducation_sdk/resources/notification.rb