Class: MaybeGraphResult
- Inherits:
-
Object
- Object
- MaybeGraphResult
- Defined in:
- lib/marmotta/maybe_graph_result.rb
Overview
Encapsulates how to handle turning a Hurley result into an RDF::Graph.
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result) ⇒ MaybeGraphResult
constructor
A new instance of MaybeGraphResult.
- #value ⇒ Object
Constructor Details
#initialize(result) ⇒ MaybeGraphResult
Returns a new instance of MaybeGraphResult.
7 8 9 |
# File 'lib/marmotta/maybe_graph_result.rb', line 7 def initialize(result) @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/marmotta/maybe_graph_result.rb', line 4 def result @result end |
Instance Method Details
#value ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/marmotta/maybe_graph_result.rb', line 11 def value if graph? parsed_graph else RDF::Graph.new end end |