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 613

Instance Attribute Details

#badge_keyString

Returns the badge being done.

Returns:

  • (String)

    the badge being done



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

attribute :badge_key, :type => String

#badge_labelString

Returns human friendly badge name.

Returns:

  • (String)

    human friendly badge name



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

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



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

attribute :badge_key, :type => String

#badge_typeSymbol

Returns the type of badge.

Returns:

  • (Symbol)

    the type of badge



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

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



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

attribute :badge_key, :type => String

#requirement_keyString

Returns the requirement being done.

Returns:

  • (String)

    the requirement being done



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

attribute :badge_key, :type => String

#requirement_labelString

Returns human firendly requirement label.

Returns:

  • (String)

    human firendly requirement label



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

attribute :badge_key, :type => String

Instance Method Details

#<=>(another) ⇒ Object

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



618
619
620
621
622
623
624
# File 'lib/osm/event.rb', line 618

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