Class: ResourceWithContexts
- Inherits:
-
Object
- Object
- ResourceWithContexts
- Includes:
- Enumerable
- Defined in:
- app/presenters/resource_with_contexts.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(options) ⇒ ResourceWithContexts
constructor
A new instance of ResourceWithContexts.
Constructor Details
#initialize(options) ⇒ ResourceWithContexts
Returns a new instance of ResourceWithContexts.
4 5 6 7 |
# File 'app/presenters/resource_with_contexts.rb', line 4 def initialize() @resource = .fetch(:resource) @graph = .fetch(:graph) end |
Instance Method Details
#each ⇒ Object
9 10 11 12 13 |
# File 'app/presenters/resource_with_contexts.rb', line 9 def each @resource.each do |fact| yield FactWithContext.new(fact: fact, graph: @graph) end end |