Class: Infrastructure::Version

Inherits:
Object
  • Object
show all
Includes:
Configurable
Defined in:
lib/infrastructure/version.rb

Instance Method Summary collapse

Methods included from Configurable

#after_assignment, #after_configure, #before_assignment, #before_configure, #callback, #callbacks, #configuration, #configuration_accessor, included

Instance Method Details

#to_sObject



17
18
19
# File 'lib/infrastructure/version.rb', line 17

def to_s
  version.to_s
end

#update_version(i, value = nil) ⇒ Object



7
8
9
10
11
# File 'lib/infrastructure/version.rb', line 7

def update_version(i, value = nil)
  array_version = configuration.version.split('.')
  array_version[i] = value || (array_version[i] || 0).to_i + 1
  assign :version, array_version.join('.')
end