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.
- #editable ⇒ Boolean
-
#field ⇒ String
The field for the requirement (passed to OSM).
-
#name ⇒ String
The name of the badge.
Instance Method Summary collapse
-
#<=>(another) ⇒ Object
Compare Badge::Requirement based on badge then field.
-
#initialize ⇒ Object
constructor
Initialize a new Badge.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Object
Initialize a new Badge
|
# File 'lib/osm/badge.rb', line 226
|
Instance Attribute Details
#badge ⇒ Osm::Badge
Returns the badge the requirement belongs to.
212 |
# File 'lib/osm/badge.rb', line 212 attribute :badge, :type => Object |
#description ⇒ String
Returns a description of the badge.
212 |
# File 'lib/osm/badge.rb', line 212 attribute :badge, :type => Object |
#editable ⇒ Boolean
212 |
# File 'lib/osm/badge.rb', line 212 attribute :badge, :type => Object |
#field ⇒ String
Returns the field for the requirement (passed to OSM).
212 |
# File 'lib/osm/badge.rb', line 212 attribute :badge, :type => Object |
#name ⇒ String
Returns the name of the badge.
212 |
# File 'lib/osm/badge.rb', line 212 attribute :badge, :type => Object |
Instance Method Details
#<=>(another) ⇒ Object
Compare Badge::Requirement based on badge then field
231 232 233 234 235 |
# File 'lib/osm/badge.rb', line 231 def <=>(another) result = self.badge <=> another.try(:badge) result = self.field <=> another.try(:field) if result == 0 return result end |
#inspect ⇒ Object
237 238 239 |
# File 'lib/osm/badge.rb', line 237 def inspect Osm.inspect_instance(self, ={:replace_with => {'badge' => :osm_key}}) end |