Class: Osm::Badge::RequirementModule
- Inherits:
-
Object
- Object
- Osm::Badge::RequirementModule
- Includes:
- ActiveAttr::Model, ActiveModel::MassAssignmentSecurity
- Defined in:
- lib/osm/badge.rb,
lib/osm/badge.rb
Overview
Ensure the constant exists for the validators
Instance Attribute Summary collapse
-
#add_column_id_to_numeric ⇒ Fixnum?
?.
-
#badge ⇒ Osm::Badge
The badge the requirement module belongs to.
-
#completed_into_column ⇒ Fixnum?
?.
-
#custom_columns ⇒ Fixnum?
?.
-
#id ⇒ Fixnum
The id for the module.
-
#letter ⇒ String
The letter of the module.
-
#min_required ⇒ Fixnum
The minimum number of requirements which must be met to achieve this module.
-
#numeric_into_column ⇒ Fixnum?
?.
Instance Method Summary collapse
-
#<=>(another) ⇒ Object
Compare Badge::RequirementModule based on badge then letter.
-
#initialize ⇒ Object
constructor
Initialize a new Badge::RequirementModule.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Object
Initialize a new Badge::RequirementModule
|
# File 'lib/osm/badge.rb', line 494
|
Instance Attribute Details
#add_column_id_to_numeric ⇒ Fixnum?
Returns ?.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#badge ⇒ Osm::Badge
Returns the badge the requirement module belongs to.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#completed_into_column ⇒ Fixnum?
Returns ?.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#custom_columns ⇒ Fixnum?
Returns ?.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#id ⇒ Fixnum
Returns the id for the module.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#letter ⇒ String
Returns the letter of the module.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#min_required ⇒ Fixnum
Returns the minimum number of requirements which must be met to achieve this module.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
#numeric_into_column ⇒ Fixnum?
Returns ?.
472 |
# File 'lib/osm/badge.rb', line 472 attribute :badge, :type => Object |
Instance Method Details
#<=>(another) ⇒ Object
Compare Badge::RequirementModule based on badge then letter
499 500 501 502 503 504 |
# File 'lib/osm/badge.rb', line 499 def <=>(another) result = self.badge <=> another.try(:badge) result = self.letter <=> another.try(:letter) if result == 0 result = self.id <=> another.try(:id) if result == 0 return result end |
#inspect ⇒ Object
506 507 508 |
# File 'lib/osm/badge.rb', line 506 def inspect Osm.inspect_instance(self, {:replace_with => {'badge' => :identifier}}) end |