Class: Finitio::FetchScope
- Inherits:
-
Object
- Object
- Finitio::FetchScope
- Defined in:
- lib/finitio/support/fetch_scope.rb
Instance Method Summary collapse
- #fetch(name, &bl) ⇒ Object
-
#initialize(parent, overrides) ⇒ FetchScope
constructor
A new instance of FetchScope.
- #with(overrides) ⇒ Object
Constructor Details
#initialize(parent, overrides) ⇒ FetchScope
Returns a new instance of FetchScope.
4 5 6 |
# File 'lib/finitio/support/fetch_scope.rb', line 4 def initialize(parent, overrides) @parent, @overrides = parent, overrides end |
Instance Method Details
#fetch(name, &bl) ⇒ Object
8 9 10 11 12 |
# File 'lib/finitio/support/fetch_scope.rb', line 8 def fetch(name, &bl) @overrides.fetch(name) do @parent.fetch(name, &bl) end end |
#with(overrides) ⇒ Object
14 15 16 |
# File 'lib/finitio/support/fetch_scope.rb', line 14 def with(overrides) FetchScope.new(self, overrides) end |