README.rdoc in instance_variable_hash-1.0.1 vs README.rdoc in instance_variable_hash-1.1.0
- old
+ new
@@ -1,7 +1,9 @@
-= InstanceVariableHash
+= InstanceVariableHash
+{<img src="https://secure.travis-ci.org/metakeule/instance_variable_hash.png" />}[https://secure.travis-ci.org/metakeule/instance_variable_hash]
+
== What is it for?
You might have attributes (in a plugin for example) that you want
to use as Hash. But if you want to set these attribute from the outside it
will be difficult to set parts of this hash at different places.
@@ -17,14 +19,14 @@
@a_b = 'val_b'
@a_c = ['c1', 'c2']
and with this lib you would have a shortcut that allows you to pass a hash:
- instance_variables_set_with_hash({ :a => {:b => 'val_b', :c => ['c1', 'c2']} })
+ ivars_from_hash({ :a => {:b => 'val_b', :c => ['c1', 'c2']} })
to get them back as a hash
- instance_variables_get_as_hash('a') # => {:b => 'val_b', :c => ['c1', 'c2']} }
+ ivars_to_hash('a') # => {:b => 'val_b', :c => ['c1', 'c2']} }
To use the lib:
require 'rubygems'
require 'instance_variable_hash'