Class: Poniard::HashSource

Inherits:
Object
  • Object
show all
Defined in:
lib/poniard/injector.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


75
76
77
# File 'lib/poniard/injector.rb', line 75

def provides?(name)
  @hash.has_key?(name)
end