Class: Yoda::HasServices::ServiceHub
- Inherits:
-
Object
- Object
- Yoda::HasServices::ServiceHub
- Defined in:
- lib/yoda/has_services.rb
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(instance) ⇒ ServiceHub
constructor
A new instance of ServiceHub.
Constructor Details
#initialize(instance) ⇒ ServiceHub
Returns a new instance of ServiceHub.
20 21 22 |
# File 'lib/yoda/has_services.rb', line 20 def initialize(instance) @instance = instance end |
Instance Attribute Details
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
18 19 20 |
# File 'lib/yoda/has_services.rb', line 18 def instance @instance end |
Class Method Details
.register_service(name, &block) ⇒ Object
24 25 26 27 28 |
# File 'lib/yoda/has_services.rb', line 24 def self.register_service(name, &block) define_method(name) do instance.instance_exec(instance, &block) end end |