Class: PublishMyData::SparqlQueryResult

Inherits:
Object
  • Object
show all
Defined in:
lib/publish_my_data/sparql_query_result.rb

Overview

 class to wrap up a string sparql result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result_str) ⇒ SparqlQueryResult

Returns a new instance of SparqlQueryResult.



8
9
10
# File 'lib/publish_my_data/sparql_query_result.rb', line 8

def initialize(result_str)
  @result_str = result_str
end

Instance Attribute Details

#result_strObject (readonly)

Returns the value of attribute result_str.



6
7
8
# File 'lib/publish_my_data/sparql_query_result.rb', line 6

def result_str
  @result_str
end

Instance Method Details

#lengthObject

responds to a bunch of to_x methods to help with rails responders /rendering.



13
14
15
# File 'lib/publish_my_data/sparql_query_result.rb', line 13

def length
  self.to_s.length
end

#to_json(opts = {}) ⇒ Object



27
28
29
# File 'lib/publish_my_data/sparql_query_result.rb', line 27

def to_json(opts={})
  to_s
end

#to_sObject



17
18
19
# File 'lib/publish_my_data/sparql_query_result.rb', line 17

def to_s
  self.result_str
end

#to_xml(opts = {}) ⇒ Object



31
32
33
# File 'lib/publish_my_data/sparql_query_result.rb', line 31

def to_xml(opts={})
  to_s
end