Class: FactWithContext
- Inherits:
-
Object
- Object
- FactWithContext
- Defined in:
- app/presenters/fact_with_context.rb
Instance Attribute Summary collapse
-
#fact ⇒ Object
readonly
Returns the value of attribute fact.
Instance Method Summary collapse
- #context_summary ⇒ Object
-
#initialize(options) ⇒ FactWithContext
constructor
A new instance of FactWithContext.
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() @fact = .fetch(:fact) @graph = .fetch(:graph) end |
Instance Attribute Details
#fact ⇒ Object (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_summary ⇒ Object
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 |