Class: Poniard::HashSource
- Inherits:
-
Object
- Object
- Poniard::HashSource
- Defined in:
- lib/poniard/injector.rb
Instance Method Summary collapse
- #dispatch(name, _) ⇒ Object
-
#initialize(hash) ⇒ HashSource
constructor
A new instance of HashSource.
- #provides?(name) ⇒ Boolean
Constructor Details
#initialize(hash) ⇒ HashSource
Returns a new instance of HashSource.
71 72 73 |
# File 'lib/poniard/injector.rb', line 71 def initialize(hash) @hash = hash end |
Instance Method Details
#dispatch(name, _) ⇒ Object
79 80 81 |
# File 'lib/poniard/injector.rb', line 79 def dispatch(name, _) @hash.fetch(name) end |
#provides?(name) ⇒ Boolean
75 76 77 |
# File 'lib/poniard/injector.rb', line 75 def provides?(name) @hash.has_key?(name) end |