Class: Osm::Badge::RequirementModule

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeObject

Initialize a new Badge::RequirementModule


# File 'lib/osm/badge.rb', line 494

Instance Attribute Details

#add_column_id_to_numericFixnum?


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#badgeOsm::Badge


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#completed_into_columnFixnum?


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#custom_columnsFixnum?


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#idFixnum


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#letterString


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#min_requiredFixnum


472
# File 'lib/osm/badge.rb', line 472

attribute :badge, :type => Object

#numeric_into_columnFixnum?


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

#inspectObject


506
507
508
# File 'lib/osm/badge.rb', line 506

def inspect
  Osm.inspect_instance(self, {:replace_with => {'badge' => :identifier}})
end