Skip to content

Commit

Permalink
Start documenting Version API
Browse files Browse the repository at this point in the history
  • Loading branch information
aldesantis committed Jan 1, 2018
1 parent 3d9e2a5 commit 9f3def8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/pragma/migration/version.rb
Expand Up @@ -2,10 +2,25 @@

module Pragma
module Migration

# Represents a version of your API.
#
# This class is used for comparing and sorting API versions and for holding the migrations
# associated to each version.
#
# Usually, versions are instantiated via {Repository.version}.
class Version
# @!attribute [r] number
# @return [String] the number of this version
#
# @!attribute [r] migrations
# @return [Array<Base>] the migrations in this version
attr_reader :number, :migrations

# Initializes the version.
#
# @param number [String] the version number (this can be anything comparable with
# +Gem::Version+)
# @param migrations [Array<Base>] the migrations in this version
def initialize(number, migrations = [])
@number = number
@migrations = migrations
Expand Down

0 comments on commit 9f3def8

Please sign in to comment.