Class: Lecture
- Inherits:
-
Object
- Object
- Lecture
- 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
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#date_created ⇒ Object
readonly
Returns the value of attribute date_created.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(json_str) ⇒ Lecture
constructor
Create an instance of Lecture based upon
json_str
that can be an hash or a JSON string. -
#to_s ⇒ Object
String representation of a Lecture object.
Constructor Details
#initialize(json_str) ⇒ Lecture
Create an instance of Lecture based upon json_str
that can be an hash or a JSON string.
14 15 16 17 18 19 20 21 22 |
# File 'lib/Appolo/Models/secondary/lecture.rb', line 14 def initialize (json_str) json_data = Appolo.check_json_info json_str @id = json_data[ModelUtils::ID] @content = json_data[ModelUtils::CONTENT] @date_created = json_data[ModelUtils::CREATED_WHEN] @title = json_data[ModelUtils::TITLE] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
9 10 11 |
# File 'lib/Appolo/Models/secondary/lecture.rb', line 9 def content @content end |
#date_created ⇒ Object (readonly)
Returns the value of attribute date_created.
9 10 11 |
# File 'lib/Appolo/Models/secondary/lecture.rb', line 9 def date_created @date_created end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/Appolo/Models/secondary/lecture.rb', line 9 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/Appolo/Models/secondary/lecture.rb', line 9 def title @title end |
Instance Method Details
#to_s ⇒ Object
String representation of a Lecture object.
26 27 28 |
# File 'lib/Appolo/Models/secondary/lecture.rb', line 26 def to_s "#{@id} - #{@title} : #{@date_created}" end |