Class: Hypo::Instance
- Inherits:
-
Object
- Object
- Hypo::Instance
- Defined in:
- lib/hypo/instance.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(object, container, name) ⇒ Instance
constructor
A new instance of Instance.
- #instance ⇒ Object
Constructor Details
#initialize(object, container, name) ⇒ Instance
Returns a new instance of Instance.
5 6 7 8 9 10 11 |
# File 'lib/hypo/instance.rb', line 5 def initialize(object, container, name) raise ContainerError, 'Registered object should have a name' if name.nil? @object = object @container = container @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/hypo/instance.rb', line 3 def name @name end |
Instance Method Details
#instance ⇒ Object
13 14 15 |
# File 'lib/hypo/instance.rb', line 13 def instance @object end |