Class: LearnSprout::Course

Inherits:
Object
  • Object
show all
Defined in:
lib/learnsprout/course.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Course

Returns a new instance of Course.



10
11
12
13
14
15
16
17
18
# File 'lib/learnsprout/course.rb', line 10

def initialize(attrs={})
    @client = attrs["client"]
    @org_id = attrs["org_id"]
    @course_id = attrs["id"]
    @name = attrs["name"]
    @number = attrs["number"]
    @time_updated = attrs["time_updated"]
    @school_id = attrs["school"]["id"]
end

Instance Attribute Details

#course_idObject

Returns the value of attribute course_id.



4
5
6
# File 'lib/learnsprout/course.rb', line 4

def course_id
  @course_id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/learnsprout/course.rb', line 4

def name
  @name
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/learnsprout/course.rb', line 4

def number
  @number
end

#school_idObject

Returns the value of attribute school_id.



4
5
6
# File 'lib/learnsprout/course.rb', line 4

def school_id
  @school_id
end

#time_updatedObject

Returns the value of attribute time_updated.



4
5
6
# File 'lib/learnsprout/course.rb', line 4

def time_updated
  @time_updated
end

Instance Method Details

#schoolObject



20
21
22
# File 'lib/learnsprout/course.rb', line 20

def school
    @client.school(@org_id, @school_id)
end