Class: SalesforceCertificationCalculator::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/salesforce_certification_calculator/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, weight, score) ⇒ Section

Creates Section object

Examples:

Create Section Object

>> my_section = Section.new('Database', 24, 85)

Parameters:

  • name (String) —

    name of the section

  • weight (Number) —

    percentage indicating how much the section is worth to the total score, represented as an integer

  • score (Number) —

    individual's score on the specific section, represented as an integer



20
21
22
23
24
# File 'lib/salesforce_certification_calculator/section.rb', line 20

def initialize(name, weight, score)
    @name = name
    @weight = weight
    @score = score
end

Instance Attribute Details

#name ⇒ String

Returns name of the section.

Returns:

  • (String) —

    name of the section



10
11
12
# File 'lib/salesforce_certification_calculator/section.rb', line 10

def name
  @name
end

#score ⇒ Number

Returns individual's score on the specific section, represented as an integer.

Returns:

  • (Number) —

    individual's score on the specific section, represented as an integer



10
# File 'lib/salesforce_certification_calculator/section.rb', line 10

attr_accessor :name, :weight, :score

#weight ⇒ Number

Returns percentage indicating how much the section is worth to the total score, represented as an integer.

Returns:

  • (Number) —

    percentage indicating how much the section is worth to the total score, represented as an integer



10
# File 'lib/salesforce_certification_calculator/section.rb', line 10

attr_accessor :name, :weight, :score