Class: Hypo::SimpleComponent

Inherits:
Object
  • Object
show all
Defined in:
lib/hypo/simple_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, container, name) ⇒ SimpleComponent

Returns a new instance of SimpleComponent.

Raises:



5
6
7
8
9
10
11
# File 'lib/hypo/simple_component.rb', line 5

def initialize(object, container, name)
  raise ContainerError, 'Registered object should have a name' if name.nil?

  @object = object
  @name = name
  @container = container
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/hypo/simple_component.rb', line 3

def name
  @name
end

Instance Method Details

#instanceObject



13
14
15
# File 'lib/hypo/simple_component.rb', line 13

def instance
  @object
end