class Pretty::Version

Included Modules

Defined in:

pretty/version.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(values : Array(Int32) | Nil = nil, build = nil, sep = nil) #

[View source]
def self.parse(string : String) : Version #

[View source]

Instance Method Detail

def <(other : Version) #

[View source]
def <=(other : Version) #

[View source]
def <=>(other : Version) #

[View source]
def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []?(*args, **options) #

[View source]
def []?(*args, **options, &) #

[View source]
def build : String #

[View source]
def build=(build : String) #

[View source]
def each(*args, **options) #

[View source]
def each(*args, **options, &) #

[View source]
def last(*args, **options) #

[View source]
def last(*args, **options, &) #

[View source]
def major #

handy accessors


[View source]
def major? #

[View source]
def minor #

[View source]
def minor? #

[View source]
def rev #

[View source]
def rev? #

[View source]
def sep : String #

[View source]
def sep=(sep : String) #

[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def values : Array(Int32) #

Pretty::Version holds version information as Array(Int32).

Pretty::Version.parse("0.27.2")[1,2]  # => [27,2]
Pretty::Version.parse("0.27.2").minor # => 27

Pretty.version("0.27.2") # shortcut for `Pretty::Version.parse`

[View source]
def values=(values : Array(Int32)) #

Pretty::Version holds version information as Array(Int32).

Pretty::Version.parse("0.27.2")[1,2]  # => [27,2]
Pretty::Version.parse("0.27.2").minor # => 27

Pretty.version("0.27.2") # shortcut for `Pretty::Version.parse`

[View source]