Class: Osm::Activity::Version

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

Overview

Class Activity::Badge

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Initialize a new Version

Parameters:

  • attributes (Hash)

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



# File 'lib/osm/activity.rb', line 369

Instance Attribute Details

#created_byFixnum

Returns the OSM user ID of the person who created this version.

Returns:

  • (Fixnum)

    the OSM user ID of the person who created this version



357
# File 'lib/osm/activity.rb', line 357

attribute :version, :type => Integer

#created_by_nameString

Returns the aname of the OSM user who created this version.

Returns:

  • (String)

    the aname of the OSM user who created this version



357
# File 'lib/osm/activity.rb', line 357

attribute :version, :type => Integer

#labelString

Returns the human readable label to use for this version.

Returns:

  • (String)

    the human readable label to use for this version



357
# File 'lib/osm/activity.rb', line 357

attribute :version, :type => Integer

#versionFixnum

Returns the version of the activity.

Returns:

  • (Fixnum)

    the version of the activity



357
# File 'lib/osm/activity.rb', line 357

attribute :version, :type => Integer

Instance Method Details

#<=>(another) ⇒ Object

Compare Version based on activity_id then version



374
375
376
377
378
# File 'lib/osm/activity.rb', line 374

def <=>(another)
  result = self.activity_id <=> another.try(:activity_id)
  result = self.version <=> another.try(:version) if result == 0
  return result
end