Class: FactWithContext

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/fact_with_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FactWithContext

Returns a new instance of FactWithContext.



4
5
6
7
# File 'app/presenters/fact_with_context.rb', line 4

def initialize(options)
  @fact = options.fetch(:fact)
  @graph = options.fetch(:graph)
end

Instance Attribute Details

#factObject (readonly)

Returns the value of attribute fact.



2
3
4
# File 'app/presenters/fact_with_context.rb', line 2

def fact
  @fact
end

Instance Method Details

#context_summaryObject



9
10
11
12
# File 'app/presenters/fact_with_context.rb', line 9

def context_summary
  context = @graph.by_subject(@fact.context_subject)
  ContextPresenter.new(context: context).context_summary
end