Class: AdHonorem::Objective

Inherits:
Object
  • Object
show all
Defined in:
lib/adhonorem/models/objective.rb

Overview

Represent a badge objective Re-created on-the-fly at each badge instantiation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slug, name, description, amount_needed = 1) ⇒ Objective

Returns a new instance of Objective.



7
8
9
10
11
12
# File 'lib/adhonorem/models/objective.rb', line 7

def initialize(slug, name, description, amount_needed = 1)
  @slug = slug
  @name = name
  @description = description
  @amount_needed = amount_needed
end

Instance Attribute Details

#amount_neededObject (readonly)

Returns the value of attribute amount_needed.



5
6
7
# File 'lib/adhonorem/models/objective.rb', line 5

def amount_needed
  @amount_needed
end

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/adhonorem/models/objective.rb', line 5

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/adhonorem/models/objective.rb', line 5

def name
  @name
end

#slugObject (readonly)

Returns the value of attribute slug.



5
6
7
# File 'lib/adhonorem/models/objective.rb', line 5

def slug
  @slug
end