Sha256: 24ea4ae4abdfb22c6006573547126a6d2a14370155eb9d0b164f0daba2b6ac47

Contents?: true

Size: 844 Bytes

Versions: 26

Compression:

Stored size: 844 Bytes

Contents

module MeducationSDK
  class MediaFile < 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,
      views_in_last_30_days: 30,
      views_in_last_60_days: 60,
      usefulness: 1
    }
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
meducation_sdk-2.0.2 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-2.0.1 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-2.0.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.16 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.15 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.14 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.13 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.12 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.11 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.10 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.6 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.5 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.4 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.3 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.2 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.1 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.6.0 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.5.7 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.5.6 lib/meducation_sdk/resources/media_file.rb
meducation_sdk-1.5.5 lib/meducation_sdk/resources/media_file.rb