Class: Moodle2CC::Moodle2::Models::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/moodle2cc/moodle2/models/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSection

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

#activitiesObject

Returns the value of attribute activities.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def activities
  @activities
end

#available_fromObject

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_untilObject

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_idObject

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

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def name
  @name
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def number
  @number
end

#positionObject

Returns the value of attribute position.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def position
  @position
end

#release_codeObject

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

#sequenceObject

Returns the value of attribute sequence.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def sequence
  @sequence
end

#show_availabilityObject

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

#summaryObject

Returns the value of attribute summary.



3
4
5
# File 'lib/moodle2cc/moodle2/models/section.rb', line 3

def summary
  @summary
end

#summary_formatObject

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

#visibleObject

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

Returns:

  • (Boolean)


11
12
13
# File 'lib/moodle2cc/moodle2/models/section.rb', line 11

def empty?
  !(summary? || activities.size > 0)
end

#summary?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/moodle2cc/moodle2/models/section.rb', line 15

def summary?
  !!(summary && !summary.strip.empty?)
end