Class: MaybeGraphResult

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ MaybeGraphResult

Returns a new instance of MaybeGraphResult.

Parameters:

  • result (Hurley::Response)

    A web response object.



7
8
9
# File 'lib/marmotta/maybe_graph_result.rb', line 7

def initialize(result)
  @result = result
end

Instance Attribute Details

#resultObject (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

#valueObject



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