Commits

Chad Perrin  committed 38fa56d

usage stuff

  • Participants
  • Parent commits 7cb97e1

Comments (0)

Files changed (1)

File ruby/README.md

 # Versionize
 
-I want simple version capabilities.  Here they are.
+I wanted simple version capabilities.  Here they are.
+
+
+## usage
+
+Using Versionize is dead simple right now.  First require and include it, then
+define your version hash, and finally use the methods Versionize provides:
+
+        #!/usr/bin/env ruby
+        require 'versionize'
+        
+        class Foo
+          include Versionize
+          @version = {
+            :major      => 1,
+            :minor      => 0,
+            :revision   => 2
+          }
+        end
+
+        Foo.version
+        Foo.version(:array)
+        Foo.version(:hash)
+        Foo.major
+        Foo.major(:string)
+        Foo.minor
+        Foo.minor(:string)
+        Foo.revision
+        Foo.revision(:string)
+
+The return values from this example are:
+
+        => "1.0.2"
+        => [1, 0, 2]
+        => {:major=>1, :minor=>0, :revision=>2}
+        => 1
+        => "1"
+        => 0
+        => "0"
+        => 2
+        => "2"
+
+That's about all there is to it.
+
 
 ## credits