Class: Lecture

Inherits:
Element show all
Defined in:
lib/Appolo/Models/secondary/lecture.rb

Overview

This class represents a lecture given at some point in some class.

Instance Attribute Summary collapse

Attributes inherited from Element

#id, #links, #short_name

Instance Method Summary collapse

Methods inherited from Element

#check_json_info

Constructor Details

#initialize(json_str) ⇒ Lecture

Create an instance of Lecture based upon json_str that can be an hash or a JSON string.



15
16
17
18
19
20
21
22
23
# File 'lib/Appolo/Models/secondary/lecture.rb', line 15

def initialize (json_str)
  json_data = check_json_info json_str

  super(json_data[ModelUtils::ID],nil,nil,nil)
  @content = json_data[ModelUtils::CONTENT]
  @date_created = json_data[ModelUtils::CREATED_WHEN]
  @title = json_data[ModelUtils::TITLE]

end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



10
11
12
# File 'lib/Appolo/Models/secondary/lecture.rb', line 10

def content
  @content
end

#date_createdObject (readonly)

Returns the value of attribute date_created.



10
11
12
# File 'lib/Appolo/Models/secondary/lecture.rb', line 10

def date_created
  @date_created
end

#titleObject (readonly)

Returns the value of attribute title.



10
11
12
# File 'lib/Appolo/Models/secondary/lecture.rb', line 10

def title
  @title
end

Instance Method Details

#to_sObject

String representation of a Lecture object.



27
28
29
# File 'lib/Appolo/Models/secondary/lecture.rb', line 27

def to_s
  "#{@id} - #{@title} : #{@date_created}"
end