Class: Osm::Activity::File

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

Overview

Ensure the constant exists for the validators

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Initialize a new Term

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 308

Instance Attribute Details

#activity_idFixnum

Returns the OSM ID for the activity.

Returns:

  • (Fixnum)

    the OSM ID for the activity



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

attribute :id, :type => Integer

#file_nameString

Returns the file name of the file.

Returns:

  • (String)

    the file name of the file



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

attribute :id, :type => Integer

#idFixnum

Returns the OSM ID for the file.

Returns:

  • (Fixnum)

    the OSM ID for the file



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

attribute :id, :type => Integer

#nameString

Returns the name of the file (more human readable than file_name).

Returns:

  • (String)

    the name of the file (more human readable than file_name)



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

attribute :id, :type => Integer

Instance Method Details

#<=>(another) ⇒ Object

Compare File based on activity_id then name



313
314
315
316
317
# File 'lib/osm/activity.rb', line 313

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