Class: Scorecard::Badge

Inherits:
Object
  • Object
show all
Defined in:
lib/scorecard/badge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier, &block) ⇒ Badge

Returns a new instance of Badge.



5
6
7
8
9
# File 'lib/scorecard/badge.rb', line 5

def initialize(identifier, &block)
  @identifier = identifier

  block.call self
end

Instance Attribute Details

#checkObject

Returns the value of attribute check.



3
4
5
# File 'lib/scorecard/badge.rb', line 3

def check
  @check
end

#gameablesObject

Returns the value of attribute gameables.



3
4
5
# File 'lib/scorecard/badge.rb', line 3

def gameables
  @gameables
end

#identifierObject (readonly)

Returns the value of attribute identifier.



2
3
4
# File 'lib/scorecard/badge.rb', line 2

def identifier
  @identifier
end

#lockedObject

Returns the value of attribute locked.



3
4
5
# File 'lib/scorecard/badge.rb', line 3

def locked
  @locked
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/scorecard/badge.rb', line 3

def name
  @name
end

#unlockedObject

Returns the value of attribute unlocked.



3
4
5
# File 'lib/scorecard/badge.rb', line 3

def unlocked
  @unlocked
end

Instance Method Details

#repeatable?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/scorecard/badge.rb', line 11

def repeatable?
  @gameables.present?
end