Sha256: a3f5cafbb6c1563f27185d94a1fccf7f929264672fe01831a1a942e484265be5

Contents?: true

Size: 1.5 KB

Versions: 6

Compression:

Stored size: 1.5 KB

Contents

module Enlight
  module Models
    class Course < Enlight::Models::Model
      attr_accessor :external_id
      attr_accessor :course_name
      attr_accessor :name
      attr_accessor :available_instructor_led
      attr_accessor :available_self_paced
      attr_accessor :organization_id
      attr_accessor :organization_name
      attr_accessor :content_provider_id
      attr_accessor :content_provider_name
      attr_accessor :description
      attr_accessor :activites
      attr_accessor :tags
      attr_accessor :custom_fields
      attr_accessor :profile_image_url
      attr_accessor :completed
      attr_accessor :started
      attr_accessor :expires
      attr_accessor :duration
      attr_accessor :duration_unit_id
      attr_accessor :html_description

      alias_method :activities, :activites

      def activites=(value)
        if value.instance_of?(Array) && value.any?
          @activites = []
          value.each {|v| @activites.append(Enlight::Models::CourseActivity.new(v))}
        else
          @activites = nil
        end
      end

      def custom_fields=(value)
        if value.instance_of?(Array) && value.any?
          @custom_fields = []
          value.each {|v| @custom_fields.append(Enlight::Models::CustomField.new(v))}
        else
          @custom_fields = nil
        end
      end

      def course_name=(value)
        @course_name = value
        @name = value
      end

      def name=(value)
        @course_name = value
        @name = value
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enlight-0.2.4 lib/enlight/models/course.rb
enlight-0.2.3 lib/enlight/models/course.rb
enlight-0.2.2 lib/enlight/models/course.rb
enlight-0.2.1 lib/enlight/models/course.rb
enlight-0.2.0 lib/enlight/models/course.rb
enlight-0.1.4 lib/enlight/models/course.rb