Class: Moodle2CC::Moodle2::Models::Section
- Inherits:
-
Object
- Object
- Moodle2CC::Moodle2::Models::Section
- Defined in:
- lib/moodle2cc/moodle2/models/section.rb
Instance Attribute Summary collapse
-
#activities ⇒ Object
Returns the value of attribute activities.
-
#available_from ⇒ Object
Returns the value of attribute available_from.
-
#available_until ⇒ Object
Returns the value of attribute available_until.
-
#grouping_id ⇒ Object
Returns the value of attribute grouping_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#position ⇒ Object
Returns the value of attribute position.
-
#release_code ⇒ Object
Returns the value of attribute release_code.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#show_availability ⇒ Object
Returns the value of attribute show_availability.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#summary_format ⇒ Object
Returns the value of attribute summary_format.
-
#visible ⇒ Object
Returns the value of attribute visible.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize ⇒ Section
constructor
A new instance of Section.
- #summary? ⇒ Boolean
Constructor Details
#initialize ⇒ Section
Returns a new instance of Section.
6 7 8 9 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 6 def initialize @sequence = [] @activities = [] end |
Instance Attribute Details
#activities ⇒ Object
Returns the value of attribute activities.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def activities @activities end |
#available_from ⇒ Object
Returns the value of attribute available_from.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def available_from @available_from end |
#available_until ⇒ Object
Returns the value of attribute available_until.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def available_until @available_until end |
#grouping_id ⇒ Object
Returns the value of attribute grouping_id.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def grouping_id @grouping_id end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def number @number end |
#position ⇒ Object
Returns the value of attribute position.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def position @position end |
#release_code ⇒ Object
Returns the value of attribute release_code.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def release_code @release_code end |
#sequence ⇒ Object
Returns the value of attribute sequence.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def sequence @sequence end |
#show_availability ⇒ Object
Returns the value of attribute show_availability.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def show_availability @show_availability end |
#summary ⇒ Object
Returns the value of attribute summary.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def summary @summary end |
#summary_format ⇒ Object
Returns the value of attribute summary_format.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def summary_format @summary_format end |
#visible ⇒ Object
Returns the value of attribute visible.
3 4 5 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3 def visible @visible end |
Instance Method Details
#empty? ⇒ Boolean
11 12 13 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 11 def empty? !(summary? || activities.size > 0) end |
#summary? ⇒ Boolean
15 16 17 |
# File 'lib/moodle2cc/moodle2/models/section.rb', line 15 def summary? !!(summary && !summary.strip.empty?) end |