Sha256: f8edc1f345ea101858e8b6fe8443d7d44e5f3a5be1c6aa63d5d5a4deae138d95

Contents?: true

Size: 765 Bytes

Versions: 8

Compression:

Stored size: 765 Bytes

Contents

module MeducationSDK
  class MediaFile < Loquor::Resource
    self.path = "/media_files"

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

    def comments
      @comments ||= Comment.where(item_id: id, item_type: "MediaFile")
    end

    module State
      def self.uploaded; 1 end
      def self.processing; 2 end
      def self.available; 3 end
      def self.redacted; 4 end
    end
  end

  class MediaFileMock < MediaFile
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      user_id: 1,
      media_type_id: 2,
      media_type: "video",
      title: "Abdominal Ultrasound Tutorial",
      preview_image_url: "http://www.example.com/1.jpg",
      mesh_headings: [{id: 1, name: "cardiology"}], 
      rating: 10
    }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
meducation_sdk-1.1.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.0.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-0.10.1 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-0.10.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-0.9.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-0.8.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-0.7.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-0.6.1 lib/meducation_sdk/resources/media_file.rb