Class: Object

Inherits:
BasicObject
Defined in:
lib/merb-core/test/test_ext/object.rb

Instance Method Summary collapse

Instance Method Details

#assigns(attr) ⇒ Object

Parameters

attr<~to_s>

The name of the instance variable to get.

Returns

Object

The instance variable @attr for this object.

Examples

# In a spec
@my_obj.assigns(:my_value).should == @my_value


11
12
13
# File 'lib/merb-core/test/test_ext/object.rb', line 11

def assigns(attr)
  self.instance_variable_get("@#{attr}")
end