class FunWith::VersionStrings::VersionString
Constants
- FORMAT_VALIDATOR
Attributes
major[RW]
minor[RW]
patch[RW]
tiny[RW]
Public Class Methods
new( src )
click to toggle source
version must be of format n.nn or n.nn.nn
Calls superclass method
# File lib/version_strings/version_string.rb, line 9 def initialize( src ) @match_data = src.match( FORMAT_VALIDATOR ) raise ArgumentError.new( "Not a valid version format for a VersionString." ) if @match_data.nil? @major = (@match_data[:major] || 0).to_i @minor = (@match_data[:minor] || 0).to_i @patch = (@match_data[:patch] || 0).to_i super( "#{@major}.#{@minor}.#{@patch}" ) end