convio/watirmark — pull request #13 by Blackbaud-JohnGarcia (2014-08-26 19:02:30+00:00)
Title: added unique_instance_name method

The unique_instance_name method is for use in the "defaults" block in model classes that inherit from `Watirmark::Model::Factory`. It can make unique default fields more identifiable based on the model_name given. If no model_name is given, the unique_instance_name method generates a name based on the model's class name.

*Example*
------------
`webform = WebFormModel.new({:model_name => "TestPage"})`
` => #`
`webform.model_name`
` => "TestPage"`
`webform.name`
` => "TestPage_12a321jks2"`

`webform = WebFormModel.new()`
`=> #`
`webform.model_name`
`=> nil`
`webform.name`
`=> "webform_12a321jks2"`

*Note: In this example, WebFormModel inherits from Watirmark::Model::Factory and `name` is set to `unique_instance_name` in WebFormModel's `defaults` block.*