Class: Osm::Event::BadgeLink

Inherits:
Model
  • Object
show all
Includes:
ActiveAttr::Model, ActiveModel::MassAssignmentSecurity
Defined in:
lib/osm/event.rb,
lib/osm/event.rb

Overview

TODO : Add validation for above statements

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#<, #<=, #>, #>=, #between?, #changed_attributes, configure, #reset_changed_attributes, #to_i

Constructor Details

#initializeObject

Initialize a new Meeting::Activity

Parameters:

  • attributes (Hash)

    The hash of attributes (see attributes for descriptions, use Symbol of attribute name as the key)



# File 'lib/osm/event.rb', line 610

Instance Attribute Details

#badge_keyString

Returns the badge being done.

Returns:

  • (String)

    the badge being done



594
# File 'lib/osm/event.rb', line 594

attribute :badge_key, :type => String

#badge_sectionSymbol

Returns the section type that the badge belongs to.

Returns:

  • (Symbol)

    the section type that the badge belongs to



594
# File 'lib/osm/event.rb', line 594

attribute :badge_key, :type => String

#badge_typeSymbol

Returns the type of badge.

Returns:

  • (Symbol)

    the type of badge



594
# File 'lib/osm/event.rb', line 594

attribute :badge_key, :type => String

#dataString

Returns what to put in the column when the badge records are updated.

Returns:

  • (String)

    what to put in the column when the badge records are updated



594
# File 'lib/osm/event.rb', line 594

attribute :badge_key, :type => String

#labelString

Returns human firendly label for the badge and requirement.

Returns:

  • (String)

    human firendly label for the badge and requirement



594
# File 'lib/osm/event.rb', line 594

attribute :badge_key, :type => String

#requirement_keyString

Returns the requirement being done.

Returns:

  • (String)

    the requirement being done



594
# File 'lib/osm/event.rb', line 594

attribute :badge_key, :type => String

Instance Method Details

#<=>(another) ⇒ Object

Compare BadgeLink based on section, type, key, requirement, data



615
616
617
618
619
620
621
# File 'lib/osm/event.rb', line 615

def <=>(another)
  [:badge_section, :badge_type, :badge_key, :requirement_key].each do |attribute|
    result = self.try(:data) <=> another.try(:data)
    return result unless result == 0
  end
  return self.try(:data) <=> another.try(:data)
end