Class: Osm::Badge::Requirement
- Inherits:
-
Object
- Object
- Osm::Badge::Requirement
- 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
-
#badge ⇒ Osm::Badge
The badge the requirement belongs to.
-
#description ⇒ String
A description of the badge requirement.
- #editable ⇒ Boolean
-
#id ⇒ Fixnum
The id for the requirement (passed to OSM).
-
#mod ⇒ Osm::Badge::RequirementModule
The module the requirement belongs to.
-
#name ⇒ String
The name of the badge requirement.
Instance Method Summary collapse
-
#<=>(another) ⇒ Object
Compare Badge::Requirement based on badge then requirement.
-
#initialize ⇒ Object
constructor
Initialize a new Badge::Requirement.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Object
Initialize a new Badge::Requirement
|
# File 'lib/osm/badge.rb', line 433
|
Instance Attribute Details
#badge ⇒ Osm::Badge
Returns the badge the requirement belongs to.
415 |
# File 'lib/osm/badge.rb', line 415 attribute :badge, :type => Object |
#description ⇒ String
Returns a description of the badge requirement.
415 |
# File 'lib/osm/badge.rb', line 415 attribute :badge, :type => Object |
#editable ⇒ Boolean
415 |
# File 'lib/osm/badge.rb', line 415 attribute :badge, :type => Object |
#id ⇒ Fixnum
Returns the id for the requirement (passed to OSM).
415 |
# File 'lib/osm/badge.rb', line 415 attribute :badge, :type => Object |
#mod ⇒ Osm::Badge::RequirementModule
Returns the module the requirement belongs to.
415 |
# File 'lib/osm/badge.rb', line 415 attribute :badge, :type => Object |
#name ⇒ String
Returns the name of the badge requirement.
415 |
# File 'lib/osm/badge.rb', line 415 attribute :badge, :type => Object |
Instance Method Details
#<=>(another) ⇒ Object
Compare Badge::Requirement based on badge then requirement
438 439 440 441 442 |
# File 'lib/osm/badge.rb', line 438 def <=>(another) result = self.badge <=> another.try(:badge) result = self.id <=> another.try(:id) if result == 0 return result end |
#inspect ⇒ Object
444 445 446 |
# File 'lib/osm/badge.rb', line 444 def inspect Osm.inspect_instance(self, {:replace_with => {'badge' => :identifier}}) end |