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 230
|
Instance Attribute Details
#badge ⇒ Osm::Badge
Returns the badge the requirement belongs to.
214 |
# File 'lib/osm/badge.rb', line 214 attribute :badge, :type => Object |
#description ⇒ String
Returns a description of the badge.
214 |
# File 'lib/osm/badge.rb', line 214 attribute :badge, :type => Object |
#editable ⇒ Boolean
214 |
# File 'lib/osm/badge.rb', line 214 attribute :badge, :type => Object |
#field ⇒ String
Returns the field for the requirement (passed to OSM).
214 |
# File 'lib/osm/badge.rb', line 214 attribute :badge, :type => Object |
#name ⇒ String
Returns the name of the badge.
214 |
# File 'lib/osm/badge.rb', line 214 attribute :badge, :type => Object |
Instance Method Details
#<=>(another) ⇒ Object
Compare Badge::Requirement based on badge then field
235 236 237 238 239 |
# File 'lib/osm/badge.rb', line 235 def <=>(another) result = self.badge <=> another.try(:badge) result = self.field <=> another.try(:field) if result == 0 return result end |
#inspect ⇒ Object
241 242 243 |
# File 'lib/osm/badge.rb', line 241 def inspect Osm.inspect_instance(self, ={:replace_with => {'badge' => :osm_key}}) end |